Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagster-dbt] Refactor UnitTestDefinition instantiation in utils.py t…
…o use `from_dict` method (#27052) Fixed: #27007 ## Summary & Motivation Today I upgraded dbt to 1.9.1 but encountered an error while running dagster. In the end, I found that UnitTestDefinition was not properly parsed. In dbt, [this is also how they create UnitTestDefinition](https://github.com/dbt-labs/dbt-core/blob/8a8857a85c0cc66c7e3de9eb7e9ca7fd63d553a4/core/dbt/parser/unit_tests.py#L609). Here are the details: 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. ## How I Tested These Changes Verified `test_dbt_with_unit_tests()` passes with both `fqn:*` and `tag:test` selectors. https://github.com/dagster-io/dagster/blob/652af9acd0495eea8b66646cad2db5fce9079151/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_asset_decorator.py#L1145-L1162
- Loading branch information