Skip to content

Commit

Permalink
fix: handle columns with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
pquadri committed Jul 16, 2024
1 parent 9f58dc5 commit 52a194a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snowflake_utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ def _set_tag(
self, cursor: SnowflakeCursor, column: str, tag_name: str, tag_value: str
) -> None:
cursor.execute(
f"ALTER TABLE {self.fqn} MODIFY COLUMN {column} SET TAG {governance_settings.fqn(tag_name)} = '{tag_value}'"
f"ALTER TABLE {self.fqn} MODIFY COLUMN "{column.upper()}" SET TAG {governance_settings.fqn(tag_name)} = '{tag_value}'"
)

def _unset_tag(self, cursor: SnowflakeCursor, column: str, tag: str):
cursor.execute(
f"ALTER TABLE {self.fqn} MODIFY COLUMN {column} UNSET TAG {governance_settings.fqn(tag)}"
f"ALTER TABLE {self.fqn} MODIFY COLUMN "{column.upper()}" UNSET TAG {governance_settings.fqn(tag)}"
)


Expand Down

0 comments on commit 52a194a

Please sign in to comment.