Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dbt-adapters/src/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,6 @@ def _catalog_filter_table(
"table_name",
"table_type",
"table_comment",
"table_owner",
"column_name",
"column_type",
"column_comment",
Expand Down
21 changes: 20 additions & 1 deletion dbt-snowflake/src/dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,27 @@ def _catalog_filter_table(
) -> "agate.Table":
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas

Comment on lines 121 to +125
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move imports above comment

Suggested change
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas
from dbt_common.clients.agate_helper import table_from_rows
from dbt.adapters.base.impl import _catalog_filter_schemas
# On snowflake, users can set QUOTED_IDENTIFIERS_IGNORE_CASE, so force
# the column names to their lowercased forms.

lowered = table.rename(column_names=[c.lower() for c in table.column_names])
return super()._catalog_filter_table(lowered, used_schemas)

table = table_from_rows(
lowered.rows,
lowered.column_names,
text_only_columns=[
"table_database",
"table_schema",
"table_name",
"table_type",
"table_owner",
"table_comment",
"column_name",
"column_type",
"column_comment",
],
)
return table.where(_catalog_filter_schemas(used_schemas))

def _make_match_kwargs(self, database, schema, identifier):
# if any path part is already quoted then consider same casing but without quotes
Expand Down
Loading