You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In BigQuery, table references can contain - in them. Test find_all_hard_coded_references.sql does not detect this because regex (\w+) does not include the hyphen (-) character.
Steps to reproduce
Sample model with hard-coded reference
SELECT
*
FROM
`project-name.dataset_name.table_name`
Expected results
09:17:43 19 of 25 FAIL 1 is_empty_fct_hard_coded_references_ ............................ [FAIL 1 in 0.82s]
Actual results
09:20:45 19 of 25 PASS is_empty_fct_hard_coded_references_ .............................. [PASS in 0.95s]
Screenshots and log output
This is after changing all regex from (\w+) to (\w+-?\w+) in find_all_hard_coded_reference.sql macro. Elswise, everything passes.
Core:
- installed: 1.7.5
- latest: 1.7.6 - Update available!
Plugins:
- bigquery: 1.7.3 - Up to date!
- postgres: 1.6.1 - Not compatible!
Are you interested in contributing the fix?
Tested locally and replaced all regex from (\w+) to (\w+-?\w+) which makes - optional. After the change, test started detecting hard-coded references with hyphen (-) character. I don't know if this will affect something else, but in my case, it worked.
Describe the bug
In BigQuery, table references can contain
-
in them. Testfind_all_hard_coded_references.sql
does not detect this because regex (\w+) does not include the hyphen (-
) character.Steps to reproduce
Sample model with hard-coded reference
Expected results
Actual results
Screenshots and log output
This is after changing all regex from
(\w+)
to(\w+-?\w+)
infind_all_hard_coded_reference.sql
macro. Elswise, everything passes.System information
Which database are you using dbt with?
The output of
dbt --version
:Are you interested in contributing the fix?
Tested locally and replaced all regex from
(\w+)
to(\w+-?\w+)
which makes-
optional. After the change, test started detecting hard-coded references with hyphen (-
) character. I don't know if this will affect something else, but in my case, it worked.https://github.com/dbt-labs/dbt-project-evaluator/blob/main/macros/find_all_hard_coded_references.sql
The text was updated successfully, but these errors were encountered: