Skip to content

Apply hook_params to deferred dbt Cloud job runs - #74199

Merged
josh-fell merged 1 commit into
apache:mainfrom
SEPURI-SAI-KRISHNA:dbt-cloud-deferred-hook-params
Oct 6, 2026
Merged

josh-fell merged 1 commit into
apache:mainfrom
SEPURI-SAI-KRISHNA:dbt-cloud-deferred-hook-params

Conversation

@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown
Contributor

DbtCloudRunJobOperator accepts hook_params, documented as "Extra arguments passed to the DbtCloudHook constructor", and applies them on the worker: its hook property is DbtCloudHook(self.dbt_cloud_conn_id, **self.hook_params). When the operator defers, it did not pass them to DbtCloudRunJobTrigger, so the triggerer built its hook as DbtCloudHook(self.conn_id) with the defaults. A configured retry_limit or retry_delay applied before the task deferred and was silently ignored afterwards.

The trigger has needed no change: it already accepts hook_params, keeps it across serialization, and uses it when it builds the hook. DbtCloudJobRunSensor already passes it, since #57242 added hook_params to the sensor to align it with the operators in this provider. That left the operator's own deferred path as the one call site still dropping it, which is what this changes.

Tests

A new test asserts the trigger receives the operator's hook_params. It fails without the one-line change.

It is worth being explicit that this also modifies an existing test. test_execute_deferrable_does_not_pass_execution_timeout_to_defer pins the trigger's complete keyword set with assert_called_once_with, so adding an argument necessarily changes it. The edit adds hook_params={}, which is what the operator's default produces. That test also fails against the unpatched operator, so the assertion is pinned to the new behaviour rather than relaxed to accommodate it.

Also run: the full providers/dbt/cloud suite (288 passed) and mypy.

On a changelog entry

I have not added one. The parameter was always documented as reaching the hook, so this makes the documented behaviour true rather than changing a contract, and a reviewer on a sibling PR of mine noted that a changelog entry for this kind of bugfix is debatable. Happy to add one if you would rather have it.

No existing issue; opening the PR directly rather than filing one first.


Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code (Opus 5)

DbtCloudRunJobOperator accepts hook_params, documented as extra arguments for
the DbtCloudHook constructor, and uses them on the worker. It did not hand them
to the trigger it defers to, so the triggerer built its hook without them and a
configured retry limit or delay was silently ignored once the task deferred.

DbtCloudRunJobTrigger has accepted, serialized and used hook_params since the
sensor started passing them, so only the operator's call site was missing.
@josh-fell
josh-fell merged commit a6d4ef0 into apache:main Oct 6, 2026
80 checks passed
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.

2 participants