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

ELE-3463 - source freshness test results elementary_unique_id fix #1647

Merged
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
10 changes: 6 additions & 4 deletions elementary/monitor/api/source_freshnesses/source_freshnesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ def _get_source_freshness_invocations(
totals.add_total(run.status)

source_freshness_invocations[unique_id] = SourceFreshnessInvocationsSchema(
fail_rate=round((totals.errors + totals.failures) / len(invocations), 2)
if invocations
else 0,
fail_rate=(
round((totals.errors + totals.failures) / len(invocations), 2)
if invocations
else 0
),
totals=totals,
invocations=list(invocations.values()),
description=f"There were {totals.failures or 'no'} failures, {totals.errors or 'no'} errors and {totals.warnings or 'no'} warnings on the last {len(invocations)} source freshness runs.",
Expand All @@ -175,7 +177,7 @@ def _get_test_metadata_from_source_freshness_results_db_row(

return SourceFreshnessMetadataSchema(
test_unique_id=source_freshness_results_db_row.unique_id,
elementary_unique_id=source_freshness_results_db_row.source_freshness_execution_id,
elementary_unique_id=source_freshness_results_db_row.unique_id,
database_name=source_freshness_results_db_row.database_name,
schema_name=source_freshness_results_db_row.schema_name,
table_name=source_freshness_results_db_row.table_name,
Expand Down
Loading