From d8415a76dd559a5acc791943597fba58e5286076 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Sat, 16 Mar 2024 23:11:12 -0700 Subject: [PATCH] Fix #9511: Handle exceptions for failing `on-run-*` hooks in `source freshness` --- .changes/unreleased/Fixes-20240316-231152.yaml | 6 ++++++ core/dbt/artifacts/schemas/freshness/v3/freshness.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20240316-231152.yaml diff --git a/.changes/unreleased/Fixes-20240316-231152.yaml b/.changes/unreleased/Fixes-20240316-231152.yaml new file mode 100644 index 00000000000..725d8bbc3c5 --- /dev/null +++ b/.changes/unreleased/Fixes-20240316-231152.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Handle exceptions for failing on-run-* hooks in source freshness +time: 2024-03-16T23:11:52.819014-07:00 +custom: + Author: aranke + Issue: "9511" diff --git a/core/dbt/artifacts/schemas/freshness/v3/freshness.py b/core/dbt/artifacts/schemas/freshness/v3/freshness.py index 5e8b4dabd30..a9b956d2863 100644 --- a/core/dbt/artifacts/schemas/freshness/v3/freshness.py +++ b/core/dbt/artifacts/schemas/freshness/v3/freshness.py @@ -107,7 +107,11 @@ class FreshnessExecutionResultArtifact( @classmethod def from_result(cls, base: FreshnessResult): - processed = [process_freshness_result(r) for r in base.results] + processed = [ + process_freshness_result(r) + for r in base.results + if isinstance(r, SourceFreshnessResult) + ] return cls( metadata=base.metadata, results=processed,