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

expect_column_proportion_of_unique_values_to_be_between throwing a compilation error #306

Closed
manuel-niederl opened this issue Apr 23, 2024 · 3 comments

Comments

@manuel-niederl
Copy link

manuel-niederl commented Apr 23, 2024

Hello! Not sure if this issue is widespread or just due to my installation but the change made to this test in 10.3 is breaking our existing implementation of the test. I'm running dbt 1.2.6.

This line was changed from

count(distinct {{ column_name }})*1.0/count({{ column_name }})

to

cast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})

which is throwing this error on our end:

dbt.exceptions.CompilationException: Compilation Error in test dbt_expectations_expect_column_proportion_of_unique_values_to_be_between_dim_invite_experiments_guest_id__1__0_99__guest_id_is_not_null (models/invite/core/invite-experimentation/_invite_experimentation.yml)
  'dict object' has no attribute 'type_float'

Please advise if this is a bug or an issue with my installation.

Update: Updating to DBT 1.3.7 fixed this issue but I still believe that I should not have encountered the bug because expectations supports lower DBT versions.

@clausherther
Copy link
Contributor

I don't remember which version of dbt brought the jinja type macros into the dbt namespace but I assume the version of dbt you're using is too old. The current stable release is 1.7.x.

https://docs.getdbt.com/reference/dbt-jinja-functions/cross-database-macros#type_float

We only test and therefore only really support the latest stable release minor version, so currently 1.7.x.

@clausherther
Copy link
Contributor

FYI, I updated the README to reflect the supported version.

@manuel-niederl
Copy link
Author

Thanks a lot for the quick answer and for updating the Readme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants