Databricks_tags are set every run
Describe the bug
The current situation is that all databricks-tags are applied every dbt run. This adds significantly to the time of a run. In our situation that means setting one tag takes around 300 milliseconds. We want to tag each column in our dbt project: setting the tags for this much columns doesn't scale very well. The production workload takes more time and it doesn't work well for developers who want to test their code.
We would like to know if it's possible that only new or changed databricks-tags will be applied, instead of all. As can be seen in the adapter, every time a table is created, all tags are set. In the apply_tags macro there is no option in which tags that have already been set are skipped (even though the tags retain).
We do see that the tags are being fetched already, but we do not see this used yet. We are wondering if this functionality, so that not all tags are being reset with every run, is on the roadmap of the maintainers of this adapter.
System information
The output of dbt --version:
Core:
- installed: 1.10.13
- latest: 1.11.2 - Update available!
Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
- databricks: 1.11.0 - Update available!
- spark: 1.9.3 - Update available!
At least one plugin is out of date with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
The operating system you're using:
MacOS
The output of python --version:
Python 3.12.12
The dbt-databricks version we're using:
dbt-databricks==1.10.4
Hi @SpaltmanDionne Thanks for bringing this up. Can you share a few more details
- Materialization type.
- Number of models in a dbt run.
- Number of column tags per model and total sum overall.
- Number of table tags per model and total sum overall.
Also what is the impact these updates are having on the overall running time of your dbt project?
@tejassp-db , the code snippet is for table materialisation, we can look to start from there.
Hi @SpaltmanDionne I am closing the issue as the issue specified in the description should work fine today and currently there are no plans to introduce functionality to remove tags through dbt-databricks. Feel free to re-open if you want to have that functionality.