Skip to content

Commit

Permalink
fix: only set tags on columns that exist
Browse files Browse the repository at this point in the history
  • Loading branch information
pquadri committed Sep 25, 2024
1 parent a53c82c commit d12836e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snowflake_utils/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ def sync_tags(self, cursor: SnowflakeCursor) -> None:

def sync_tags_columns(self, cursor: SnowflakeCursor) -> None:
tags = self.current_column_tags()
columns = [c.name.upper() for c in self.get_columns(cursor)]
existing_tags = {
f"{column}.{tag_name}.{tags[column][tag_name]}".casefold(): (
column,
Expand All @@ -410,6 +411,7 @@ def sync_tags_columns(self, cursor: SnowflakeCursor) -> None:
for tag_name, tag_value in self.table_structure.columns[
column.casefold()
].tags.items()
if column.upper() in columns
}

for tag in existing_tags:
Expand Down

0 comments on commit d12836e

Please sign in to comment.