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

test is_empty_fct_hard_coded_references fails for any string of the format 'a.b.c' #527

Closed
1 of 6 tasks
will-regal-voice opened this issue Jan 27, 2025 · 2 comments
Closed
1 of 6 tasks
Labels
bug Something isn't working triage

Comments

@will-regal-voice
Copy link

will-regal-voice commented Jan 27, 2025

Describe the bug

the test is_empty_fct_hard_coded_references fails for any string of the format 'a.b.c', even if it is not a table reference.

Steps to reproduce

Add a line like

WHERE column_1 = 'a.b.c'

This doesn't seem like the intention of the test. IMO it should be restricted to only the FROM clause or similar.

Expected results

the test doesn't fail

Actual results

the test fails

Screenshots and log output

System information

The contents of your packages.yml file:

packages:

  • package: calogica/dbt_expectations
    version: 0.10.4
  • package: dbt-labs/audit_helper
    version: 0.12.1
  • package: dbt-labs/codegen
    version: 0.13.1
  • package: dbt-labs/dbt_utils
    version: 1.3.0
  • package: get-select/dbt_snowflake_monitoring
    version: 5.3.1
  • package: dbt-labs/dbt_project_evaluator
    version: 1.0.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • trino/starburst
  • other (specify: ____________)

The output of dbt --version:

Core:
  - installed: 1.8.0
  - latest:    1.9.1 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - snowflake: 1.8.1 - Update available!

  At least one plugin is out of date or incompatible with dbt-core.
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Additional context

Are you interested in contributing the fix?

@will-regal-voice will-regal-voice added bug Something isn't working triage labels Jan 27, 2025
@dave-connors-3
Copy link
Collaborator

hey @will-regal-voice ! thanks for the issue. the macro that contains the regex should be looking only at from and join clauses, but it's regex, so it's a bit finnicky. we can try to take a look and see if we can reproduce the error!

@will-regal-voice
Copy link
Author

apologies, it turns out this was an issue with a multi-line comment in the same model. That comment had the phrase "from a.b.c", which failed the test. It wasn't "from" in the SQL meaning, but it makes sense that it failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants