Skip to content

refactor: drop no-op create_indexes and commit from snapshot materialization - #1691

Merged
sd-db merged 4 commits into
mainfrom
sd-db/snapshot-remove-noops
Oct 11, 2026
Merged

sd-db merged 4 commits into
mainfrom
sd-db/snapshot-remove-noops

Conversation

@sd-db

@sd-db sd-db commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Description

The snapshot materialization made two calls that do nothing on Databricks:

  • create_indexes() on the first run dispatches to dbt's default, which emits no SQL because neither Spark nor Databricks implements get_create_index_sql.
  • adapter.commit() after the inside-transaction post-hooks resolves to commit_if_has_connection(), which the adapter overrides as a no-op.

Both came in with the dbt 1.9 snapshot port (#904), copied from dbt-core's default materialization. This removes them and updates the snapshot flow doc. Hook ordering is unchanged.

The same pair is removed from seeds in #1690. The two PRs are independent.

The only user-visible effect is for projects that override create_indexes (or get_create_index_sql) and expect snapshots to call it. Those overrides are no longer called for snapshots, so the CHANGELOG entry is labeled breaking for custom macro overrides only.

Tests

No test changes. Ran the snapshot-related functional suites on main and then against this change on the SQL warehouse profile: simple_snapshot/*, the basic snapshot check-cols and timestamp tests, snapshot column tags, tags, grants, persist constraints, tblproperties, and dbt clone. Both runs gave 53 passed and 8 skipped, with identical per-test outcomes. The skips depend on the environment or profile.

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

…ization

The snapshot materialization called create_indexes() on first run and
adapter.commit() after the inside-transaction post-hooks. Both do nothing
on Databricks: create_indexes dispatches to dbt's default, which emits no
SQL because neither Spark nor Databricks implements get_create_index_sql,
and adapter.commit() resolves to the adapter's no-op
commit_if_has_connection(). Hook ordering is unchanged.
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@sd-db
sd-db marked this pull request as ready for review September 30, 2026 04:19
@sd-db
sd-db merged commit d6fefeb into main Oct 11, 2026
9 checks passed
@sd-db
sd-db deleted the sd-db/snapshot-remove-noops branch October 11, 2026 09:48
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.

2 participants