-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop mis-identifying
unit_test
config paths in dbt_project.yaml
a…
…s unused (#10312) * Add basic semantic layer fixture nodes to unit test `manifest` fixture We're doing this in preperation to a for a unit test which will be testing these nodes (as well as others) and thus we want them in the manifest. * Add `WhereFilterInteresection` to `QueryParams` of `saved_query` fixture In the previous commit, 58990aa, we added the `saved_query` fixture to the `manifest` fixture. This broke the test `tests/unit/parser/test_manifest.py::TestPartialParse::test_partial_parse_by_version`. It broke because the `Manifest.deepcopy` manifest basically dictifies things. When we were dictifying the `QueryParams` of the `saved_query` before, the `where` key was getting dropped because it was `None`. We'd then run into a runtime error on instantiation of the `QueryParams` because although `where` is declared as _optional_, we don't set a default value for it. And thus, kaboom :( We should probably provide a default value for `where`. However that is out of scope for this branch of work. * Fix `test_select_fqn` to account for newly included semantic model In 58990aa we added a semantic model to the `manifest` fixture. This broke the test `tests/unit/graph/test_selector_methods.py::test_select_fqn` because in the test it selects nodes based on the string `*.*.*_model`. The newly added semantic model matches this, and thus needed to be added to the expected results. * Add unit tests for `_warn_for_unused_resource_config_paths` method Note: At this point the test when run with for a `unit_test` config taht should be considered used, fails. This is because it is not being properly identified as used. * 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.
- Loading branch information
Showing
5 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters