Skip to content

Surface dbt Cloud failure details in Airflow task logs - #70171

Open
br413 wants to merge 4 commits into
apache:mainfrom
br413:feat/dbt-cloud-surface-failure-logs
Open

Surface dbt Cloud failure details in Airflow task logs#70171
br413 wants to merge 4 commits into
apache:mainfrom
br413:feat/dbt-cloud-surface-failure-logs

Conversation

@br413

@br413 br413 commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • Add log_job_run_failure_details to DbtCloudHook to fetch run steps and log status, messages, and failed step details
  • Call it from wait_for_job_run_status, DbtCloudRunJobOperator, and DbtCloudJobRunSensor before raising on ERROR/CANCELLED
  • Add unit tests for formatting, logging, and failure-path integration

Closes #46923

Test plan

  • pytest providers/dbt/cloud/tests/unit/dbt/cloud/hooks/test_dbt.py -k log_job_run_failure
  • pytest providers/dbt/cloud/tests/unit/dbt/cloud/sensors/test_dbt.py -k poke_with_exception
  • CI provider-dbt-cloud checks pass

Log run status, status messages, and failed run steps when a dbt Cloud
job run reaches ERROR or CANCELLED in the hook, operator, and sensor.

Closes apache#46923
br413 added 3 commits July 21, 2026 02:39
- Mock log_job_run_failure_details in deferrable operator failure test

- Expect extra get_job_run call when logging ERROR/CANCELLED runs

- Fix sensor test account_id assertion; add newsfragment; ruff format
@br413

br413 commented Aug 5, 2026

Copy link
Copy Markdown
Author

Rebased onto latest \main\ and fixed CI (5136e5d + 8a7a4bc): mock failure logging in deferrable operator test, expect the extra \get_job_run\ fetch on ERROR/CANCELLED paths, fix sensor \�ccount_id\ assertion, add newsfragment, ruff-format. Ready for another CI run when you have a moment.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surfacing of DBT Cloud Logs to the logs of the DBTCloudRunJobOperator

1 participant