From 294a6cb9ddb0b9dc98b51895bc16f3bbc527ac16 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 20 Jun 2024 14:58:51 -0600 Subject: [PATCH 1/4] Add null check before calling project_evaluated --- src/dbt_score/evaluation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbt_score/evaluation.py b/src/dbt_score/evaluation.py index 41b5e0f..ff116fb 100644 --- a/src/dbt_score/evaluation.py +++ b/src/dbt_score/evaluation.py @@ -72,4 +72,7 @@ def evaluate(self) -> None: self.project_score = self._scorer.score_aggregate_models( list(self.scores.values()) ) - self._formatter.project_evaluated(self.project_score) + + # Add null check before calling project_evaluated + if self._manifest_loader.models: + self._formatter.project_evaluated(self.project_score) \ No newline at end of file From 2884747aa7279212c02c7deac76aa3d6d2ca2a1c Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 20 Jun 2024 15:18:51 -0600 Subject: [PATCH 2/4] Apply linter and formatting corrections --- src/dbt_score/evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbt_score/evaluation.py b/src/dbt_score/evaluation.py index ff116fb..da35b3a 100644 --- a/src/dbt_score/evaluation.py +++ b/src/dbt_score/evaluation.py @@ -75,4 +75,4 @@ def evaluate(self) -> None: # Add null check before calling project_evaluated if self._manifest_loader.models: - self._formatter.project_evaluated(self.project_score) \ No newline at end of file + self._formatter.project_evaluated(self.project_score) From f7bd1de8bb2870cf6260738b56eb1c6314c33710 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 23 Jun 2024 22:58:25 -0600 Subject: [PATCH 3/4] Add to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0718890..5fc0ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to - Add `fail_any_model_under` configuration. - **Breaking:** default values of `5.0` for `project_fail_under` and `fail_any_model_under` will cause command to exit return code 1. +- Add null check before calling `project_evaluated` in the `evaluate` method to + prevent errors when no models are found. See PR #64. ## [0.2.1] - 2024-06-17 From 85c309d78978dba4a51002b60c81c3b552337db2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 24 Jun 2024 07:45:40 -0600 Subject: [PATCH 4/4] Add changelog to unreleased --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fc0ca9..323d145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to ## [Unreleased] +- Add null check before calling `project_evaluated` in the `evaluate` method to + prevent errors when no models are found. See PR #64. + ## [0.3.0] - 2024-06-20 ### Added @@ -16,8 +19,6 @@ and this project adheres to - Add `fail_any_model_under` configuration. - **Breaking:** default values of `5.0` for `project_fail_under` and `fail_any_model_under` will cause command to exit return code 1. -- Add null check before calling `project_evaluated` in the `evaluate` method to - prevent errors when no models are found. See PR #64. ## [0.2.1] - 2024-06-17