Skip to content

Honor transaction: false hooks - #1679

Open
gauravshirore96 wants to merge 1 commit into
databricks:mainfrom
gauravshirore96:fix/transaction-false-hooks
Open

Honor transaction: false hooks#1679
gauravshirore96 wants to merge 1 commit into
databricks:mainfrom
gauravshirore96:fix/transaction-false-hooks

Conversation

@gauravshirore96

Copy link
Copy Markdown

Resolves #1549

Description

Databricks does not support the transaction semantics used by dbt-core's
default run_hooks macro.

Previously, transaction: false hooks were silently skipped on the V1
materialization path, while the V2 path could fail with
NO_ACTIVE_TRANSACTION because dbt-core emits an explicit COMMIT.

This change overrides run_hooks for Databricks so that hooks are executed
in a single pass without transaction filtering or an explicit COMMIT.
The V1 and V2 pre/post-hook paths now execute hooks consistently.

Testing

  • tests/unit/macros: 263 passed
  • tests/unit: 1350 passed, 4 skipped, 1 unrelated failure due to missing Node.js
  • Functional hook tests could not run locally because the Databricks test configuration has no http_path.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.
  • [Optional] I have run the dbt-databricks-pr-ready project skill for this PR and addressed its merge-readiness feedback

Signed-off-by: Gaurav Shirore <shiroregaurav2@gmail.com>
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.

transaction: false model/seed hooks are not honored (silently skipped on default path, error on v2/seed/metric_view)

1 participant