Skip to content

Commit

Permalink
Make relation filtering None-tolerant for maximal flexibility across …
Browse files Browse the repository at this point in the history
…adapters. (#8975)
  • Loading branch information
peterallenwebb authored Nov 1, 2023
1 parent bb21403 commit 7fddd6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231101-155824.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Make relation filtering None-tolerant for maximal flexibility across adapters.
time: 2023-11-01T15:58:24.552054-04:00
custom:
Author: peterallenwebb
Issue: "8974"
9 changes: 6 additions & 3 deletions core/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,12 @@ def get_filtered_catalog(
}

def in_map(row: agate.Row):
d = _expect_row_value("table_database", row).casefold()
s = _expect_row_value("table_schema", row).casefold()
i = _expect_row_value("table_name", row).casefold()
d = _expect_row_value("table_database", row)
s = _expect_row_value("table_schema", row)
i = _expect_row_value("table_name", row)
d = d.casefold() if d is not None else None
s = s.casefold() if s is not None else None
i = i.casefold() if i is not None else None
return (d, s, i) in relation_map

catalogs = catalogs.where(in_map)
Expand Down

0 comments on commit 7fddd6e

Please sign in to comment.