Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let VersionTracker optionally ignore archive steps #2448

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/step_update/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _load_version_tracker(self) -> None:
# It can be used when initializing StepUpdater, but also to reload steps_df after making changes to the dag.

# Initialize version tracker.
self.tracker = VersionTracker()
self.tracker = VersionTracker(ignore_archive=True)

# Update the temporary dag.
_update_temporary_dag(dag_active=self.tracker.dag_active, dag_all_reverse=self.tracker.dag_all_reverse)
Expand Down
14 changes: 9 additions & 5 deletions etl/version_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,17 @@ class VersionTracker:
"snapshot://dummy/2020-01-01/dummy_full.csv",
]

def __init__(self, connect_to_db: bool = True, warn_on_archivable: bool = True):
# Load dag of active and archive steps (a dictionary where each item is step: set of dependencies).
self.dag_all = load_dag(paths.DAG_ARCHIVE_FILE)
def __init__(self, connect_to_db: bool = True, warn_on_archivable: bool = True, ignore_archive: bool = False):
# Load dag of active steps (a dictionary step: set of dependencies).
self.dag_active = load_dag(paths.DAG_FILE)
if ignore_archive:
# Fully ignore the archive dag (so that all steps are only active steps, and there are no archive steps).
self.dag_all = self.dag_active.copy()
else:
# Load dag of active and archive steps.
self.dag_all = load_dag(paths.DAG_ARCHIVE_FILE)
# Create a reverse dag (a dictionary where each item is step: set of usages).
self.dag_all_reverse = reverse_graph(graph=self.dag_all)
# Load dag of active steps.
self.dag_active = load_dag(paths.DAG_FILE)
# Create a reverse dag (a dictionary where each item is step: set of usages) of active steps.
self.dag_active_reverse = reverse_graph(graph=self.dag_active)
# Generate the dag of only archive steps.
Expand Down
Loading