Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure we catch single character dbs and schemas #509

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
9 changes: 8 additions & 1 deletion integration_tests/models/marts/fct_model_6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ select 1 as id
select
5 as id
from {{ var('my_table_reference', 'table_d') }}

union all
select
5 as id
from a.b.c
union all
select
5 as id
from a.b

#}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
model,hard_coded_references
fct_model_6,"""my_db"".""my_schema"".""my_table"", ""my_schema"".""raw_relation_5"", ""raw_relation_2"", 'my_db'.'my_schema'.'my_table', 'my_schema'.'raw_relation_5', 'raw_relation_4', [my_db].[my_schema].[my_table], [my_schema].[raw_relation_5], [raw_relation_3], `my_db`.`my_schema`.`my_table`, `my_schema`.`raw_relation_5`, `project-name.dataset_name.table_name`, `raw_relation_1`, my_db.my_schema.my_table, my_schema.raw_relation_5, {{ var(""my_table_reference"") }}, {{ var(""my_table_reference"", ""table_d"") }}, {{ var('my_table_reference') }}, {{ var('my_table_reference', 'table_d') }}"
fct_model_6,"""my_db"".""my_schema"".""my_table"", ""my_schema"".""raw_relation_5"", ""raw_relation_2"", 'my_db'.'my_schema'.'my_table', 'my_schema'.'raw_relation_5', 'raw_relation_4', [my_db].[my_schema].[my_table], [my_schema].[raw_relation_5], [raw_relation_3], `my_db`.`my_schema`.`my_table`, `my_schema`.`raw_relation_5`, `project-name.dataset_name.table_name`, `raw_relation_1`, a.b, a.b.c, my_db.my_schema.my_table, my_schema.raw_relation_5, {{ var(""my_table_reference"") }}, {{ var(""my_table_reference"", ""table_d"") }}, {{ var('my_table_reference') }}, {{ var('my_table_reference', 'table_d') }}"
10 changes: 5 additions & 5 deletions macros/find_all_hard_coded_references.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

# third matching group
# at least 1 word character
(\w+-?\w+)
(\w+-?\w*)

# fouth matching group
# 1 or 0 of (closing bracket, backtick, or quotation mark)
Expand All @@ -150,7 +150,7 @@

# seventh matching group
# at least 1 word character
(\w+-?\w+)
(\w+-?\w*)

# eighth matching group
# 1 or 0 of (closing bracket, backtick, or quotation mark) folowed by a whitespace character or end of string
Expand All @@ -173,7 +173,7 @@

# third matching group
# at least 1 word character
(\w+-?\w+)
(\w+-?\w*)

# fouth matching group
# 1 or 0 of (closing bracket, backtick, or quotation mark)
Expand All @@ -189,7 +189,7 @@

# seventh matching group
# at least 1 word character
(\w+-?\w+)
(\w+-?\w*)

# eighth matching group
# 1 or 0 of (closing bracket, backtick, or quotation mark)
Expand All @@ -205,7 +205,7 @@

# eleventh matching group
# at least 1 word character
(\w+-?\w+)
(\w+-?\w*)

# twelfth matching group
# 1 or 0 of (closing bracket, backtick, or quotation mark) followed by a whitespace character or end of string
Expand Down