Skip to content

feat: catalogs.yml v2 support via bridge_v2_catalog hooks#1440

Open
aahel wants to merge 28 commits into
databricks:mainfrom
aahel:feat/catalogs-v2-configs
Open

feat: catalogs.yml v2 support via bridge_v2_catalog hooks#1440
aahel wants to merge 28 commits into
databricks:mainfrom
aahel:feat/catalogs-v2-configs

Conversation

@aahel

@aahel aahel commented May 4, 2026

Copy link
Copy Markdown

Summary

Adds catalogs.yml v2 support to dbt-databricks using the adapter-owned bridge architecture.

What changed

impl.py

  • Declares Capability.CatalogsV2 — enables v2 path when use_catalogs_v2: true is set in dbt_project.yml
  • Adds _v2_to_v1_type hook: unity → unity, hive_metastore → hive_metastore

catalogs/_unity.py

  • Adeed warnings if use_uniform is set in config properties
  • location_root must be non-blank if provided

catalogs/_hive_metastore.py

  • Adds file_format enum validation in HiveMetastoreCatalogIntegration.__init__: must be one of delta | parquet | hudi

Architecture

dbt-core parses catalogs.yml v2 structurally, checks Capability.CatalogsV2, then calls adapter.bridge_v2_catalog(catalog). The base adapter template method reads catalog.config.get("databricks", {}) and calls _v2_to_v1_type to resolve the v1 catalog_type. Field-level validation happens in CatalogIntegration.__init__ — same as v1, no new interface.

Companion PRs:

Test plan

  • Unit tests for UnityCatalogIntegration.__init__ validation
  • Unit tests for HiveMetastoreCatalogIntegration.__init__ validation
  • Functional tests end-to-end once dbt-core and dbt-adapters PRs are merged

Adds UnityDatabricksConfig and HiveMetastoreDatabricksConfig dataclasses
and declares them on DatabricksAdapter.CATALOG_V2_CONFIGS. This enables
parse-time validation of catalogs.yml v2 when the use_catalogs_v2
behavior flag is set in dbt-core.

UnityDatabricksConfig enforces file_format='parquet' when use_uniform is
false/unset, and 'delta' when use_uniform=true. HiveMetastoreDatabricksConfig
accepts delta, parquet, or hudi.

Both schemas are dbtClassMixin dataclasses — structural validation
(unknown keys, required fields) via jsonschema; semantic constraints
in __post_init__.
@aahel aahel marked this pull request as draft May 4, 2026 11:20
@aahel aahel marked this pull request as ready for review May 4, 2026 11:59
@aahel aahel marked this pull request as draft May 6, 2026 18:21
…hook methods

- Remove CATALOG_V2_CONFIGS and _v2.py typed dataclasses (old approach)
- Add Capability.CatalogsV2 and _v2_to_v1_type hook (new approach)
- Move use_uniform x file_format validation into UnityCatalogIntegration.__init__
- Move file_format enum validation into HiveMetastoreCatalogIntegration.__init__
@aahel aahel changed the title feat: declare CATALOG_V2_CONFIGS for catalogs.yml v2 support feat: catalogs.yml v2 support via bridge_v2_catalog hooks May 11, 2026
@aahel aahel marked this pull request as ready for review May 25, 2026 05:12
Comment thread CHANGELOG.md Outdated
Comment thread dbt/adapters/databricks/catalogs/_unity.py Outdated
Comment thread dbt/adapters/databricks/catalogs/_unity.py Outdated
sd-db added a commit that referenced this pull request Jun 11, 2026
Raises the `dbt-adapters` upper bound from `<1.23.0` to `<1.25.0`
(latest is 1.24.2) and refreshes `uv.lock` to match. Floor is unchanged;
the resolved version stays at 1.22.9.

Unblocks #1440
use_uniform has no effect on runtime DDL today — the use_managed_iceberg
behavior flag drives actual table creation. Warn users so they are not
silently misled. Proper wiring of use_uniform is a follow-up PR.
Comment thread dbt/adapters/databricks/impl.py Outdated
@aahel aahel requested a review from sd-db June 11, 2026 11:34
@sd-db

sd-db commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

/integration-test

@github-actions

Copy link
Copy Markdown

Integration tests dispatched for PR #1440 by @sd-db. Track progress in the Actions tab.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  impl.py
  dbt/adapters/databricks/catalogs
  _unity.py 27
Project Total  

This report was generated by python-coverage-comment-action

…PR link

Move optional CatalogsV2 capability setup into _adapter_capabilities()
next to _capabilities (no behavior change) and link the 1.12.2 changelog
entry to PR databricks#1440.
@github-actions

Copy link
Copy Markdown

Integration results for PR #1440 — UC cluster ✅ success · SQL warehouse ✅ success · All-purpose cluster ✅ success · Shard coverage ✅ success

Run details.

@sd-db sd-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes look good, thx for the PR !

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