Skip to content

fix(dbt): correctly treat dbt-fusion test status pass as successful in asset checks (#33512)#33518

Open
vidiyala99 wants to merge 3 commits into
dagster-io:masterfrom
vidiyala99:fix/dbt-fusion-test-status
Open

fix(dbt): correctly treat dbt-fusion test status pass as successful in asset checks (#33512)#33518
vidiyala99 wants to merge 3 commits into
dagster-io:masterfrom
vidiyala99:fix/dbt-fusion-test-status

Conversation

@vidiyala99

Copy link
Copy Markdown
Contributor

Summary & Motivation

Fixes #33512

When using dbt-fusion (dbt CLI v2.x) with dagster-dbt, dbt tests that successfully complete are incorrectly reported as failed asset checks (passed=False) in the Dagster UI.

This happens because DbtFusionCliEventMessage._get_check_passed() currently determines success using a strict comparison against NodeStatus.Success ("success"). While model executions emit "success", dbt tests in dbt-fusion emit a "pass" status.

Since "pass" != "success", all successful test nodes are incorrectly marked as failed.

This PR updates _get_check_passed() to treat both:

  • NodeStatus.Success ("success") and
  • TestStatus.Pass ("pass")

as successful outcomes when evaluating asset checks.

Impact

  • Fixes incorrect failure reporting for dbt test checks in Dagster UI
  • Restores parity with DbtCoreCliEventMessage, which already handles TestStatus.Pass correctly
  • Ensures consistent behavior across dbt runtimes (dbt-core and dbt-fusion)

How I Tested These Changes

  • Reviewed the existing DbtCoreCliEventMessage pipeline to confirm that TestStatus.Pass is treated as a success case.
  • Created simulated dbt-fusion NodeFinished JSON payloads for:
    • "pass" (test success)
    • "fail" (test failure)
    • "success" (model execution)
  • Verified that msg._get_check_passed() now evaluates to:
    • True for "pass"
    • False for "fail"
    • True for "success"
  • Confirmed no changes to other execution paths or dependencies.

@greptile-apps

greptile-apps Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixed a bug where dbt-fusion tests were incorrectly marked as failed in asset checks. The _get_check_passed() method in DbtFusionCliEventMessage now correctly treats both NodeStatus.Success ("success") and TestStatus.Pass ("pass") as successful outcomes. This aligns with dbt-fusion's behavior where model executions emit "success" while test executions emit "pass".

Key changes:

  • Updated the status check from a single equality comparison to an inclusion check using a tuple
  • Maintains consistency with the approach used in related methods for handling both success statuses

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a targeted bug fix with a single line modification that correctly addresses the reported issue. The logic is sound and aligns with enum definitions in the codebase. The only minor consideration is the lack of automated tests, but the fix itself is correct.
  • No files require special attention

Important Files Changed

Filename Overview
python_modules/libraries/dagster-dbt/dagster_dbt/core/dbt_cli_event.py Updated _get_check_passed() to accept both "success" and "pass" statuses, fixing incorrect failure reporting for dbt-fusion tests

Last reviewed commit: 7e69fad

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread python_modules/libraries/dagster-dbt/dagster_dbt/core/dbt_cli_event.py Outdated
@vidiyala99 vidiyala99 force-pushed the fix/dbt-fusion-test-status branch from 86a9dfa to 3a8fc97 Compare February 27, 2026 19:52
@vidiyala99 vidiyala99 force-pushed the fix/dbt-fusion-test-status branch from 3a8fc97 to 63fb7f2 Compare March 13, 2026 03:19
@vidiyala99 vidiyala99 force-pushed the fix/dbt-fusion-test-status branch from 63fb7f2 to 25ea440 Compare April 1, 2026 03:41
@vidiyala99

Copy link
Copy Markdown
Contributor Author

@OwenKephart mind taking a look when you have a chance? This is a small dagster-dbt / dbt-fusion fix with regression tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dagster-dbt] Fusion: dbt test with status 'pass' incorrectly reported as failed asset check

1 participant