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

Weird behavior of asset check for dbt python model #18386

Closed
dduong1603 opened this issue Nov 29, 2023 · 3 comments
Closed

Weird behavior of asset check for dbt python model #18386

dduong1603 opened this issue Nov 29, 2023 · 3 comments
Assignees
Labels
area: asset-checks Related to Asset Checks type: bug Something isn't working

Comments

@dduong1603
Copy link

Dagster version

1.5.9

What's the issue?

For context, I'm running dbt python model with dbt-fal.

When a job execute both the materialization and the asset checks runs, somehow the asset checks are skipped with this info message op 'dbt_python_assets' did not yield or return expected outputs. However, if I run the asset checks alone (using the Execute All in the Checks tab), the checks run as expected, using the same dbt command. The same dbt command runs normally in the terminal as well, and I don't see this behavior with a regular dbt SQL model, so I'm not really sure how to debug this.

The code to define the python asset is below. It's the same code as a regular dbt SQL asset, just with different profile target.

@dbt_assets(
    manifest=DBT_DAGSTER_MANIFEST,
    select="tag:fal",
    exclude="resource_type:seed",
    dagster_dbt_translator=dagster_global_dbt_translator, # enable asset check
)
def dbt_python_assets(
    context: OpExecutionContext,
    dbt: DbtCliResource,
):
    yield from dbt.cli(
        ["run", "--target", f"{deployment_name}-with-fal"], context=context
    ).stream()
    yield from dbt.cli(
        ["test", "--target", f"{deployment_name}-with-fal"], context=context
    ).stream()

What did you expect to happen?

Asset check can run successfully (not skipped) in the same run as asset materialization

How to reproduce?

No response

Deployment type

Dagster Helm chart

Deployment details

No response

Additional information

No response

Message from the maintainers

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

@dduong1603 dduong1603 added the type: bug Something isn't working label Nov 29, 2023
@johannkm johannkm added the area: asset-checks Related to Asset Checks label Nov 30, 2023
@johannkm
Copy link
Contributor

@dduong1603 Did this happen to occur only when executing all models and tests in dbt_python_assets? A fix is going out today in release 1.5.10 for a bug where checks wouldn't run when not doing a subset: #18117

@johannkm johannkm self-assigned this Nov 30, 2023
@dduong1603
Copy link
Author

@dduong1603 Did this happen to occur only when executing all models and tests in dbt_python_assets? A fix is going out today in release 1.5.10 for a bug where checks wouldn't run when not doing a subset: #18117

oh interesting. yeah dbt_python_assets currently only has 1 asset so no subsetting was done on it. I'll keep an eye on for 1.5.10 to test out. Thank you!

@dduong1603
Copy link
Author

@johannkm happy to say that the behavior is now correct with 1.5.10 :) thank you!

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

No branches or pull requests

2 participants