-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix value in set validation #91
Fix value in set validation #91
Conversation
@@ -1,11 +1,11 @@ | |||
select | |||
1 as idx, | |||
'2020-10-21' as date_col, | |||
cast(0 as{{ dbt_utils.type_float() }}) as col_numeric_a, | |||
cast(1 as{{ dbt_utils.type_float() }}) as col_numeric_b, | |||
cast(0 as {{ dbt_utils.type_float() }}) as col_numeric_a, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, not sure how that happened!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, the old version compiles to
cast(0 as
float64
) as col_numeric_a
so shouldn't throw an error but still a good change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me it was compiling as cast(0 asfloat64) as col_numneric_a
so it was throwing an error
macros/math/rand.sql
Outdated
|
||
{% macro redshift__rand() %} | ||
|
||
random() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to include this in this PR? Or was this necessary for you to pass the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default function rand
doesn't exist in redshift so it was throwing an error. I use dbt with redshift that's why I ran into this issue!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, yeah this package doesn't support Redshift very well because I don't have a way to test there.
I think what I'll do is take this out and move this to a separate PR, since this isn't directly related to the issue you opened. That way, I'll also better remember to add this to the dbt 0.20 branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@ahmedrad this and the Redshift |
* Update project for dbt 0.20.0 compatibility * First batch of test macro to test block conversions * Shim dbt utils types macro * Update test macros to tests * Update description of type check tests (#84) * Update changelog for new release (#86) * Update README.md * Remove unnecessary macro to fix issue with 0.19.2 (#88) * Remove unnecessary macro to fix issue with 0.19.2 * Update changelog * Fix value in set validation (#91) * Add redshift to random macro * Fix value in set validation * Add integration test * Fix missing space that was causing syntax error when compiled * Move Redshift random() to separate PR Co-authored-by: clausherther <claus@calogica.com> * Add support for Redshift random function (#92) * Update changelog for 0.3.7 (#93) * Update project for dbt 0.20.0 compatibility * First batch of test macro to test block conversions * Shim dbt utils types macro * Update test macros to tests * Update CHANGELOG * Bump dbt-date to 0.4.0+ Co-authored-by: Noel Gomez <noel_gomez@yahoo.com> Co-authored-by: Ahmed Radwan <ahmedrad@gmail.com>
This is a fix for this bug: https://github.com/calogica/dbt-expectations/issues/90