Skip to content

Commit

Permalink
Lowercase node_name in comparison to match even if it is uppercase (#74)
Browse files Browse the repository at this point in the history
* Lowercase node_name in comparison to match even if it is uppercase

* Add test cases
  • Loading branch information
syou6162 authored and datnguye committed Feb 7, 2024
1 parent d5a1590 commit 3ae8e74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbterd/adapters/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def is_satisfied_by_exact(table: Table, rule: str = ""):
"""
if not rule:
return True
return table.node_name == rule
return table.node_name.lower() == rule


def is_satisfied_by_schema(table: Table, rule: str = ""):
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/adapters/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ def test_has_unsupported_rule(self, rule, expected):
"model.dummy.table1",
True,
),
(
Table(
name="irrelevant",
node_name="model.dummy.Table1",
database="dummydb",
schema="dummyschema",
),
"model.dummy.table1",
True,
),
],
)
def test_is_satisfied_by_exact(self, table, rule, expected):
Expand Down

0 comments on commit 3ae8e74

Please sign in to comment.