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

not_null_proportion.sql cannot hanlde function in group_by_columns #977

Open
4 tasks
chaubilly opened this issue Dec 30, 2024 · 1 comment
Open
4 tasks
Labels
bug Something isn't working triage

Comments

@chaubilly
Copy link

Describe the bug

In not_null_proportion macro, when function is used in one of group_by_columns, it fails.

Steps to reproduce

Below is an example model config that will trigger the error. Redshift syntax is used.

  • name: dummy_model
    tests:
    - not_null_proportion:
    at_least: 0.999
    group_by_columns: ["date_trunc('month', dummy_date)::date"]

Expected results

Test should run properly with the provided group_by_columns.

Actual results

Error raised.

09:56:48  Database Error in test not_null_proportion_dummy_model (models\_models.yml)
09:56:48    column "dummy_date" does not exist in validation
09:56:48    compiled Code at target\run\dummy_dbt\models\_models.yml\not_null_proportion_xxx.sql

Screenshots and log output

System information

The contents of your packages.yml file:

Which database are you using dbt with?

  • postgres
  • [v] redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

Core:
  - installed: 1.5.3
  - 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:
  - postgres:  1.5.3 - Update available!
  - redshift:  1.5.5 - Update available!
  - sqlserver: 1.3.1 - Not compatible!

  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?

Yes

@chaubilly
Copy link
Author

Here is a pull request for this issue.
#976

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

1 participant