Skip to content

Commit

Permalink
[dagster-dbt] Refactor UnitTestDefinition instantiation in utils.py t…
Browse files Browse the repository at this point in the history
…o use from_dict method

Verified `test_dbt_with_unit_tests()` passes with both "fqn:*" and "tag:test" selectors.

Updated the instantiation of UnitTestDefinition in the __getattr__
method to utilize the from_dict method instead of the constructor. This
change enhances the clarity and consistency of the code when handling
unit test nodes from the manifest JSON.

Fixed: dagster-io#27007
  • Loading branch information
kang8 committed Jan 13, 2025
1 parent 7b439c1 commit 2569dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python_modules/libraries/dagster-dbt/dagster_dbt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __getattr__(self, item):
{
"unit_tests": {
# unit test nodes must be of type UnitTestDefinition
unique_id: UnitTestDefinition(**info)
unique_id: UnitTestDefinition.from_dict(info)
for unique_id, info in manifest_json["unit_tests"].items()
},
}
Expand Down

0 comments on commit 2569dbe

Please sign in to comment.