Skip to content

Commit 80b7b40

Browse files
Merge pull request #2087 from elementary-data/core-255-include-seeds-wo-tests-in-dashboard
Include Seeds and Snapshots w/o Tests in Dashboard
2 parents c8ed0b2 + e2fb768 commit 80b7b40

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

elementary/monitor/api/filters/filters.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from elementary.monitor.api.models.schema import (
66
ModelRunsSchema,
77
NormalizedModelSchema,
8+
NormalizedSeedSchema,
9+
NormalizedSnapshotSchema,
810
NormalizedSourceSchema,
911
)
1012
from elementary.monitor.api.totals_schema import TotalsSchema
@@ -25,11 +27,15 @@ def get_filters(
2527
models: Dict[str, NormalizedModelSchema],
2628
sources: Dict[str, NormalizedSourceSchema],
2729
models_runs: List[ModelRunsSchema],
30+
seeds: Dict[str, NormalizedSeedSchema],
31+
snapshots: Dict[str, NormalizedSnapshotSchema],
2832
) -> FiltersSchema:
2933
test_results_filters = self._get_test_filters(
30-
test_results_totals, models, sources
34+
test_results_totals, models, sources, seeds, snapshots
35+
)
36+
test_runs_filters = self._get_test_filters(
37+
test_runs_totals, models, sources, seeds, snapshots
3138
)
32-
test_runs_filters = self._get_test_filters(test_runs_totals, models, sources)
3339
model_runs_filters = self._get_model_runs_filters(models_runs)
3440
return FiltersSchema(
3541
test_results=test_results_filters,
@@ -42,6 +48,8 @@ def _get_test_filters(
4248
totals: Dict[str, TotalsSchema],
4349
models: Dict[str, NormalizedModelSchema],
4450
sources: Dict[str, NormalizedSourceSchema],
51+
seeds: Dict[str, NormalizedSeedSchema],
52+
snapshots: Dict[str, NormalizedSnapshotSchema],
4553
) -> List[FilterSchema]:
4654
failures_filter = FilterSchema(name="failures", display_name="Failures")
4755
warnings_filter = FilterSchema(name="warnings", display_name="Warnings")
@@ -50,7 +58,12 @@ def _get_test_filters(
5058
no_tests_filter = FilterSchema(name="no_test", display_name="No Tests")
5159

5260
totals_models_ids = totals.keys()
53-
artifacts: List[ArtifactSchema] = [*models.values(), *sources.values()]
61+
artifacts: List[ArtifactSchema] = [
62+
*models.values(),
63+
*sources.values(),
64+
*seeds.values(),
65+
*snapshots.values(),
66+
]
5467
for artifact in artifacts:
5568
if artifact.unique_id and artifact.unique_id not in totals_models_ids:
5669
no_tests_filter.add_model_unique_id(artifact.unique_id)

elementary/monitor/api/report/report.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ def get_report_data(
161161
lineage_node_ids, exclude_elementary_models
162162
)
163163
filters = filters_api.get_filters(
164-
test_results_totals, test_runs_totals, models, sources, models_runs.runs
164+
test_results_totals,
165+
test_runs_totals,
166+
models,
167+
sources,
168+
models_runs.runs,
169+
seeds,
170+
snapshots,
165171
)
166172

167173
serializable_groups = groups.dict()

0 commit comments

Comments
 (0)