Remove governed tags before dropping a column
Describe the bug
When attempting to drop a column that has a governed tag, the operation fails because dbt-databricks doesn't remove the tags before dropping the column.
Steps To Reproduce
- Add a governed tag to a column using a service principal
- Modify your dbt model to remove that column
- Run the model using the service principal that has rights to the governed tag
- The column drop operation will fail because the column still has a governed tag
Expected behavior
Before dropping a column, dbt-databricks should automatically remove any governed tags from the column, allowing the drop operation to succeed while respecting tag governance policies.
System information
The output of dbt --version:
Core:
- installed: 1.10.13
Plugins:
- databricks: 1.10.19
The operating system you're using: MacOS
The output of python --version:
Python 3.12.12
This is the error message that it creates ErrorClass=INVALID_PARAMETER_VALUE.CANNOT_DROP_TAGGED_COLUMN] Column cannot be dropped because it has one or more governed tags assigned. Please remove the tag(s) before dropping the column. For guidance please refer to the documentation https://docs.databricks.com/aws/en/database-objects/tags#drop.