dbt-databricks icon indicating copy to clipboard operation
dbt-databricks copied to clipboard

Feature Request: Databricks tags in a project level

Open lifood opened this issue 1 year ago • 5 comments

Describe the feature

While dbt-databricks supports defining databricks_tags for specific tables and columns in schema.yml, I would like the ability to define project-level databricks_tags that apply to all models by default. These default tags should be overridable by any tags specified at the individual model level. Ideally, this global configuration would be defined in either dbt_project.yml or schema.yml.

Describe alternatives you've considered

To achieve this, I am currently using a custom macro based on the solution provided in this dbt Discourse thread. The macro functions correctly and implements the desired behavior; however, its implementation leverages meta tags rather than the native databricks_tags configuration.

Who will this benefit?

Everyone who uses databricks_tags today

lifood avatar Sep 19 '25 13:09 lifood

@lifood what use case do you have in mind? We are working on something similar that could do what you need: query tags (or I think Databricks calls it query labeling). Query tags would apply consistently to every query associated with a model, and we are planning to allow hierarchical configuration.

benc-db avatar Sep 22 '25 17:09 benc-db

We are building a dbt architecture to support multiple teams within our company. A key requirement is that every table created by a team's dbt models must have default tags applied based on the project's owning team. For example: [team: platform, owners: [email protected], slug: data]. Crucially, the framework must support overriding these default tags at the individual model level to handle exceptions, such as assigning a different owner to a specific table.

lifood avatar Sep 23 '25 15:09 lifood

I am not familiar with query tags, but if they apply to the queries themselves and not the final tables, then I don't think they would suit our needs.

lifood avatar Sep 23 '25 15:09 lifood

ah, ok, for ownership (as opposed to cost tracking) I can see the importance. So, fundamentally the issue is that when you use a map type, dbt replaces rather than merges as you go deeper into the hierarchy. The only way we're able to get hierarchical behavior for query tags is by having the definition in the profile level get combined with a definition at the model level. We could maybe do something similar for tags.

benc-db avatar Sep 23 '25 16:09 benc-db

We would be very grateful for that. It would be an incredibly helpful feature for our use case.

lifood avatar Sep 24 '25 13:09 lifood

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue.

github-actions avatar Apr 09 '26 02:04 github-actions

This is fixed post #1340 and will go out with v1.12 release. @lifood please do test it out once the release goes out (early may/maybe as early as next week) and let us know. I am closing the issue for now, feel free to re-open later if you face issues.

sd-db avatar Apr 28 '26 12:04 sd-db