From ffd12722adb7165791102af277165c89a35d2ff9 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Thu, 13 Jun 2024 18:32:02 -0700 Subject: [PATCH] Include `unit_tests` in `Manifest.get_resouce_fqns` Because `unit_tests` weren't being included in calls to `Manifest.get_resource.fqns`, it always appeared to `_warn_for_unused_resource_config_paths` that there were no unit tests in the manifest. Because of this `_warn_for_unused_resource_config_paths` thought that _any_ `unit_test` config in `dbt_project.yaml` was unused. --- .changes/unreleased/Fixes-20240613-183117.yaml | 6 ++++++ core/dbt/contracts/graph/manifest.py | 1 + 2 files changed, 7 insertions(+) create mode 100644 .changes/unreleased/Fixes-20240613-183117.yaml diff --git a/.changes/unreleased/Fixes-20240613-183117.yaml b/.changes/unreleased/Fixes-20240613-183117.yaml new file mode 100644 index 00000000000..14b1ee2bf08 --- /dev/null +++ b/.changes/unreleased/Fixes-20240613-183117.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: DOn't warn on `unit_test` config paths that are properly used +time: 2024-06-13T18:31:17.486497-07:00 +custom: + Author: QMalcolm + Issue: "10311" diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index 9ca11166388..2b0f29403e6 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -988,6 +988,7 @@ def get_resource_fqns(self) -> Mapping[str, PathSet]: self.metrics.values(), self.semantic_models.values(), self.saved_queries.values(), + self.unit_tests.values(), ) for resource in all_resources: resource_type_plural = resource.resource_type.pluralize()