-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cross-task temporary dir to share downloaded notes
This commit adds a global temporary directory that can be used to share data between disparate bits of code/tasks. Specifically, the first user of this is fhir_utils.get_docref_note which now caches any downloaded notes in this temporary directory. This will make it much more performant to add a second NLP task (it won't have to re-download the notes). Like all temporary directories managed via context manager, this directory will be cleaned up upon ETL finishing or being interrupted by an error. It is also created with mode 0700, so only the ETL user can read the files.
- Loading branch information
Showing
5 changed files
with
133 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""Global test fixtures and setup""" | ||
|
||
import tempfile | ||
|
||
import pytest | ||
|
||
from cumulus_etl import common | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def isolated_temp_dir(): | ||
"""The global temp dir should be defined by default""" | ||
with tempfile.TemporaryDirectory() as tempdir: | ||
common.set_global_temp_dir(tempdir) | ||
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters