Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jvasquezrojas committed Dec 9, 2024
1 parent a05a87c commit 0c074ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/snowflake/sqlalchemy/snowdialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ def get_columns(self, connection, table_name, schema=None, **kw):
raise sa_exc.NoSuchTableError()
return schema_columns[normalized_table_name]

def get_prefixes_from_data(self, n2i, row, **kw):
def get_prefixes_from_data(self, name_to_index_map, row, **kw):
prefixes_found = []
for valid_prefix in CustomTablePrefix:
key = f"is_{valid_prefix.name.lower()}"
if key in n2i and row[n2i[key]] == "Y":
if key in name_to_index_map and row[name_to_index_map[key]] == "Y":
prefixes_found.append(valid_prefix.name)
return prefixes_found

Expand All @@ -695,11 +695,11 @@ def _get_schema_tables_info(self, connection, schema=None, **kw):
)
)

n2i = self._map_name_to_idx(result)
name_to_index_map = self._map_name_to_idx(result)
tables = {}
for row in result.cursor.fetchall():
table_name = self.normalize_name(str(row[n2i["name"]]))
table_prefixes = self.get_prefixes_from_data(n2i, row)
table_name = self.normalize_name(str(row[name_to_index_map["name"]]))
table_prefixes = self.get_prefixes_from_data(name_to_index_map, row)
tables[table_name] = {"prefixes": table_prefixes}

return tables
Expand Down

0 comments on commit 0c074ca

Please sign in to comment.