Skip to content

Commit 2d071b1

Browse files
committed
Include seeds without tests in filters
1 parent 5cdc1dd commit 2d071b1

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

elementary/monitor/api/filters/filters.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from elementary.monitor.api.models.schema import (
66
ModelRunsSchema,
77
NormalizedModelSchema,
8+
NormalizedSeedSchema,
89
NormalizedSourceSchema,
910
)
1011
from elementary.monitor.api.totals_schema import TotalsSchema
@@ -25,11 +26,14 @@ def get_filters(
2526
models: Dict[str, NormalizedModelSchema],
2627
sources: Dict[str, NormalizedSourceSchema],
2728
models_runs: List[ModelRunsSchema],
29+
seeds: Dict[str, NormalizedSeedSchema],
2830
) -> FiltersSchema:
2931
test_results_filters = self._get_test_filters(
30-
test_results_totals, models, sources
32+
test_results_totals, models, sources, seeds
33+
)
34+
test_runs_filters = self._get_test_filters(
35+
test_runs_totals, models, sources, seeds
3136
)
32-
test_runs_filters = self._get_test_filters(test_runs_totals, models, sources)
3337
model_runs_filters = self._get_model_runs_filters(models_runs)
3438
return FiltersSchema(
3539
test_results=test_results_filters,
@@ -42,6 +46,7 @@ def _get_test_filters(
4246
totals: Dict[str, TotalsSchema],
4347
models: Dict[str, NormalizedModelSchema],
4448
sources: Dict[str, NormalizedSourceSchema],
49+
seeds: Dict[str, NormalizedSeedSchema],
4550
) -> List[FilterSchema]:
4651
failures_filter = FilterSchema(name="failures", display_name="Failures")
4752
warnings_filter = FilterSchema(name="warnings", display_name="Warnings")
@@ -50,7 +55,11 @@ def _get_test_filters(
5055
no_tests_filter = FilterSchema(name="no_test", display_name="No Tests")
5156

5257
totals_models_ids = totals.keys()
53-
artifacts: List[ArtifactSchema] = [*models.values(), *sources.values()]
58+
artifacts: List[ArtifactSchema] = [
59+
*models.values(),
60+
*sources.values(),
61+
*seeds.values(),
62+
]
5463
for artifact in artifacts:
5564
if artifact.unique_id and artifact.unique_id not in totals_models_ids:
5665
no_tests_filter.add_model_unique_id(artifact.unique_id)

elementary/monitor/api/report/report.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ 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,
165170
)
166171

167172
serializable_groups = groups.dict()

0 commit comments

Comments
 (0)