-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dagster-dbt] Refactor UnitTestDefinition instantiation in utils.py to use from_dict
method
#27052
base: master
Are you sure you want to change the base?
[dagster-dbt] Refactor UnitTestDefinition instantiation in utils.py to use from_dict
method
#27052
Conversation
652af9a
to
2569dbe
Compare
Hey kang8 - Thanks for your contribution! I'm in favor of this change. What was the error message you received before? Would it possible to add a new unit test to make sure the use case is covered? |
…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
2569dbe
to
9452c84
Compare
Just like issue #27007, when I upgrade dbt to version 1.9.1 and run Click to display error message.
Then I spent some time testing and found that there are currently no tests covering dbt 1.9. I have added tests for dbt 1.9 in 9452c84. PS: This is my first time learning about tox and buildkite, I'm not sure if I added the dbt 1.9 test correctly, if there are any issues, please feel free to point them out.
Adding support for dbt 1.9 in the test is enough, because the existing tests have already covered this situation, it's just that the dbt 1.9 version was not tested before. |
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.
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 bothfqn:*
andtag:test
selectors.dagster/python_modules/libraries/dagster-dbt/dagster_dbt_tests/core/test_asset_decorator.py
Lines 1145 to 1162 in 652af9a