Skip to content

feat: support key-only databricks_tags#1339

Open
canbekley wants to merge 9 commits intodatabricks:1.12.latestfrom
canbekley:feat/support-for-key-only-databricks-tags
Open

feat: support key-only databricks_tags#1339
canbekley wants to merge 9 commits intodatabricks:1.12.latestfrom
canbekley:feat/support-for-key-only-databricks-tags

Conversation

@canbekley
Copy link
Copy Markdown
Contributor

@canbekley canbekley commented Feb 27, 2026

Resolves #1270

Description

Provides a solution to add support for configuring key-only databricks_tags for tables and columns. Utilizes existing databricks sql patterns, which treat values of key-only patterns as empty strings (when queried from information_schema.tags and also when applied via sql: ALTER TABLE ... SET TAGS ('key_only_tag' = '', ...))

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.

Signed-off-by: Can Bekleyici <can.bekleyici@deepl.com>
Signed-off-by: Can Bekleyici <can.bekleyici@deepl.com>
@sd-db sd-db requested a review from jprakash-db as a code owner April 20, 2026 05:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks/relation_configs
  column_tags.py
  tags.py
Project Total  

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

Copy link
Copy Markdown
Collaborator

@sd-db sd-db left a comment

Choose a reason for hiding this comment

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

Have added some comments on changes, apart from that would be good to have a functional test. We can specially test the scenario in #1270 as a test to verify.

Comment thread dbt/adapters/databricks/relation_configs/column_tags.py Outdated
Comment thread dbt/adapters/databricks/relation_configs/column_tags.py Outdated
Comment thread dbt/adapters/databricks/relation_configs/tags.py Outdated
Comment thread dbt/adapters/databricks/relation_configs/tags.py Outdated
Comment thread dbt/include/databricks/macros/relations/tags.sql Outdated
Comment thread tests/functional/adapter/column_tags/fixtures.py Outdated
Comment thread tests/functional/adapter/column_tags/fixtures.py
@sd-db sd-db self-assigned this Apr 21, 2026
@sd-db
Copy link
Copy Markdown
Collaborator

sd-db commented Apr 23, 2026

Hi @canbekley — thanks a lot for driving this one, and apologies for the delay on our side. Quick heads-up: this is a quarterly priority for our team and I'm looking to land it this week. If you have bandwidth to continue, please let me know. Otherwise, I can drive the change to completion — I'll push the remaining fixes directly to your branch so your commits stay and you remain co-author on anything I add. Please let me know either way when you get a chance.

@canbekley
Copy link
Copy Markdown
Contributor Author

hi @sd-db , thank you for your thorough review! I can commit the suggested changes later today and let you know.

@canbekley
Copy link
Copy Markdown
Contributor Author

hi @sd-db , I applied your suggestions. can you check again please?

@canbekley canbekley requested a review from sd-db April 23, 2026 22:22
- Add `null_value:` (bare key, YAML parses to None) alongside the existing
  empty-string case in the column-tags functional fixtures. This matches
  the exact input form reported in databricks#1270 and exercises the
  `None -> ""` coercion end-to-end.
- CHANGELOG: fix "settings" typo and mention that `None` is also accepted
  as an input form for key-only tags.

Co-authored-by: Can Bekleyici <can.bekleyici@deepl.com>
@sd-db
Copy link
Copy Markdown
Collaborator

sd-db commented Apr 24, 2026

Pushed two small follow-ups directly to the branch (68e4cb9a):

  • Functional coverage for YAML null: tests/functional/adapter/column_tags/ fixtures now include a null_value: (bare-key) entry alongside the existing key_only: "", so the exact input form reported in How do I apply a valueless/key-only column tags? #1270 round-trips end-to-end.
  • CHANGELOG: fixed the settings typo and added mention of None as an accepted input.

@sd-db sd-db changed the base branch from main to 1.12.latest April 24, 2026 08:42
@sd-db
Copy link
Copy Markdown
Collaborator

sd-db commented Apr 24, 2026

I have also rebased this to 1.12.latest as this might be regarded as a behaviour change as well, hence merging into 1.12.latest (next) is safer

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.

How do I apply a valueless/key-only column tags?

2 participants