-
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 1.9.7 fails to initialize if a dbt model has unit tests #27007
Labels
Comments
stiabh
changed the title
Dagster fails to start if a dbt model has unit tests, after upgrading to dbt 1.9
dbt-dagster crashes fails to start if a dbt model has unit tests, after upgrading to dbt 1.9
Jan 10, 2025
stiabh
changed the title
dbt-dagster crashes fails to start if a dbt model has unit tests, after upgrading to dbt 1.9
dbt-dagster crashes on dbt models with unit tests, after upgrading to dbt 1.9
Jan 10, 2025
stiabh
changed the title
dbt-dagster crashes on dbt models with unit tests, after upgrading to dbt 1.9
Dagster fails to start if a dbt model has unit tests, after upgrading to dbt 1.9
Jan 10, 2025
stiabh
changed the title
Dagster fails to start if a dbt model has unit tests, after upgrading to dbt 1.9
Dagster 1.9.7 fails to start if a dbt model has unit tests
Jan 10, 2025
stiabh
changed the title
Dagster 1.9.7 fails to start if a dbt model has unit tests
Dagster 1.9.7 fails to initialize if a dbt model has unit tests
Jan 10, 2025
kang8
added a commit
to kang8/dagster
that referenced
this issue
Jan 13, 2025
…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
kang8
added a commit
to kang8/dagster
that referenced
this issue
Jan 14, 2025
…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
Is there a workaround this issue ? Is anyone actively working on a fix ? |
@jakubczaplicki A fix is in development: #27052 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the issue?
Dagster will fail to initialize if any dbt model has an associated unit test, due to a slight change to unit test config in dbt 1.9. (With the release of dagster-dbt 0.25.7, dagster supports dbt 1.9).
dbt 1.9 added support for disabling unit tests: dbt-labs/dbt-core#10831
In doing so, the config dict of the "unit_tests" attribute in the dbt manifest is expected to be dot-accessible: dbt-labs/dbt-core@81067d4#diff-b4756f21e0fa65b77bb36828994d3a758360b5acd05bbb9526b5bfe399194617
Dicts are not dot-accessible in Python by default, and dagster-dbt handles this with the
_DictShim
class inutils.py
when parsing the dbt manifest. The problem that theunit_tests
block in the manifest has to be unpacked into adbt.contracts.graph.nodes.UnitTestDefinition
object. As the element is unpacked, the config attibute is not _DictShim, but a normal dict instead, and thereby not dot-accessible. See https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-dbt/dagster_dbt/utils.py#L54Solution
The
Manifest
object produced inselect_unique_ids_from_manifest()
has to ensure that its attributeunit_tests.config
is dot accessible.Error message returned by
dagster dev
What did you expect to happen?
No response
How to reproduce?
Install dbt-dagster 0.25.7 and dbt >=1.9.0 and initialize dagster with a dbt project containing at least one unit test.
Dagster version
1.9.7
Deployment type
None
Deployment details
No response
Additional information
No response
Message from the maintainers
Impacted by this issue? Give it a 👍! We factor engagement into prioritization.
The text was updated successfully, but these errors were encountered: