-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The snapshot directories will now go in data/snapshots/. This commit also removes the incremental harvesting logic. If you want to artificially limit the sul_pub harvesting you can set this in your `.env` file: ``` AIRFLOW_VAR_DEV_LIMIT=25000 ``` Closes #26
- Loading branch information
Showing
6 changed files
with
39 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import datetime | ||
|
||
from pathlib import Path | ||
|
||
|
||
def create_snapshot_dir(data_dir): | ||
snapshots_dir = Path(data_dir) / "snapshots" | ||
|
||
if not snapshots_dir.is_dir(): | ||
snapshots_dir.mkdir() | ||
|
||
now = datetime.datetime.now() | ||
snapshot_dir = snapshots_dir / now.strftime("%Y%m%d%H%M%S") | ||
snapshot_dir.mkdir() | ||
|
||
return str(snapshot_dir) |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
from pathlib import Path | ||
|
||
from rialto_airflow.utils import create_snapshot_dir | ||
|
||
def test_create_snapshot_dir(tmpdir): | ||
snap_dir = Path(create_snapshot_dir(tmpdir)) | ||
assert snap_dir.is_dir() |