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

Remove governed tags before dropping a column

Open SpaltmanDionne opened this issue 9 months ago • 1 comments

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

  1. Add a governed tag to a column using a service principal
  2. Modify your dbt model to remove that column
  3. Run the model using the service principal that has rights to the governed tag
  4. 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

SpaltmanDionne avatar Feb 16 '26 07:02 SpaltmanDionne

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.

DejiDE avatar Jun 15 '26 10:06 DejiDE