Skip to content

perf: fetch table tags through Unity Catalog API - #1603

Open
sd-db wants to merge 3 commits into
1.13.latestfrom
sd-db/use-uc-table-tags-api-1.13
Open

perf: fetch table tags through Unity Catalog API#1603
sd-db wants to merge 3 commits into
1.13.latestfrom
sd-db/use-uc-table-tags-api-1.13

Conversation

@sd-db

@sd-db sd-db commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

Table-tag metadata reads currently use system.information_schema.table_tags, which sends each relation lookup through the more restrictive information-schema path. This changes only table_tags metadata reads to use the Unity Catalog Entity Tag Assignments API through the adapter existing authenticated WorkspaceClient.

  • Fetch table assignments with one API request per Unity Catalog relation, requesting the maximum 50 tags supported per entity.
  • Use the API for incremental tables, views, materialized views, and metric views while preserving the existing metadata-skip behavior.
  • Keep Hive Metastore relations off the Unity Catalog API.
  • Keep column_tags on its existing INFORMATION_SCHEMA path; batching column assignments is outside this PR.
  • Retain the public fetch_tags macro as a compatibility surface for projects that invoke or override it directly.

Verification

  • Affected unit tests: 43 passed
  • Full unit suite on 1.13.latest: 1,263 passed, 7 skipped
  • Live Unity Catalog metadata-fetch tests: 7 passed
  • Ruff, Ruff format, mypy, and uv lock consistency

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

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  api_client.py 298, 982
  impl.py 1251
  dbt/adapters/databricks/relation_configs
  tags.py
Project Total  

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

…uards

Reading table tags through the Unity Catalog API turned a Hive Metastore
compiler error into a silent skip for views, so an HMS view configured with
databricks_tags diffed against an empty tag set instead of failing. Raise for
Hive Metastore in _get_table_tags, the single point every relation API funnels
through, so no read path can skip silently.

The three metadata-fetch tests had been rewritten to assert a tag row exists in
information_schema, which also holds before the API switch and so could not
catch a regression back to the macro path. Reinstate the fetch_tags override
alongside the tag assertion so each test proves reads bypass the macro and the
tags are correct.

Also correct the pagination comment: max_results is a page size, not a cap, and
the SDK generator follows next_page_token, so no 50-tag limit is relied on.
@sd-db

sd-db commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/integration-test

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Integration tests dispatched for PR #1603 by @sd-db. Testing commit 6c201cc. Track progress in the Actions tab.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

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

Run details.

@sd-db
sd-db marked this pull request as ready for review August 10, 2026 05:01
@sd-db
sd-db requested a review from jprakash-db as a code owner August 10, 2026 05:01
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.

1 participant