Skip to content
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 cannot proceed after dbt test passes successfully #19717

Closed
brandybobandyistaken opened this issue Feb 9, 2024 · 1 comment
Closed
Labels
integration: dbt Related to dagster-dbt type: bug Something isn't working

Comments

@brandybobandyistaken
Copy link

Dagster version

dagster=1.5.13, dagster-dbt=0.21.13

What's the issue?

I'm using dagster to orchestrate dbt models.

The dbt test passess successfully, as indicated by the stdout in the dagster asset:

5 of 13 PASS not_null_base_report__report_created_on ........................... [PASS in 0.14s]

Yet the asset fails immediately fails afterward, citing the following error:

2024-02-09 10:37:26 -0700 - dagster - ERROR - __ASSET_JOB_0 - 1c2628fa-d4f4-4169-9ea4-2328ca34b3d5 - 2973656 - dbt_base_report_assets - STEP_FAILURE - Execution of step "dbt_base_report_assets" failed.

dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "dbt_base_report_assets"::

KeyError: 'test.dbt_etl.not_null_base_report__report_created_on.0ebb9b39f4'

Stack Trace:
  File "/code/prod/venv/lib/python3.8/site-packages/dagster/_core/execution/plan/utils.py", line 54, in op_execution_error_boundary
    yield
  File "/code/prod/venv/lib/python3.8/site-packages/dagster/_utils/__init__.py", line 465, in iterate_with_context
    next_output = next(iterator)
  File "/code/prod/ds-reporting-scheduling/ds_reporting_scheduling/assets/dbt/dbt_assets.py", line 220, in dbt_base_report_assets
    yield from dbt.cli(dbt_build_args, context=context).stream()
  File "/code/prod/venv/lib/python3.8/site-packages/dagster_dbt/core/resources_v2.py", line 390, in stream
    yield from event.to_default_asset_events(
  File "/code/prod/venv/lib/python3.8/site-packages/dagster_dbt/core/resources_v2.py", line 178, in to_default_asset_events
    upstream_unique_ids: List[str] = manifest["parent_map"][unique_id]

When running the same dbt model directly though the dbt cli, everything passes, including the test.

It seems to me like when running and testing the model through dagster, the test does indeed pass, but dagster cannot access metadata about it for whatever it needs to do next.

What did you expect to happen?

I expected this to work as it normally does. These models were previously executing fine being orchestrated by dagster, and this appeared out of thin air.

How to reproduce?

Not sure.

Deployment type

Local

Deployment details

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

@brandybobandyistaken brandybobandyistaken added the type: bug Something isn't working label Feb 9, 2024
@garethbrickman garethbrickman added the integration: dbt Related to dagster-dbt label Feb 9, 2024
@rexledesma
Copy link
Member

This sounds like:

  • You created a new test for a dbt model (e.g. not_null_base_report__report_created_on).
  • Afterwards, you didn't recompile the dbt manifest for Dagster to read from when invoking the dbt computation.
  • Since the manifest wasn't updated, searching manifest with the new test id will result in an error.

Let me know if the issue is resolved on your end. We can reopen the issue if there's another underlying problem. If you have a repro that would be great as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: dbt Related to dagster-dbt type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants