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

Fix value in set validation #91

Merged
merged 5 commits into from
Jul 11, 2021

Conversation

ahmedrad
Copy link
Contributor

@ahmedrad ahmedrad commented Jul 9, 2021

@@ -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,
Copy link
Contributor

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!

Copy link
Contributor

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.

Copy link
Contributor Author

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


{% macro redshift__rand() %}

random()
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor

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.

@clausherther clausherther linked an issue Jul 11, 2021 that may be closed by this pull request
Copy link
Contributor

@clausherther clausherther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@clausherther clausherther merged commit 7e82e7a into calogica:main Jul 11, 2021
@clausherther
Copy link
Contributor

@ahmedrad this and the Redshift random PR is now in release 0.3.7, should be on dbt package hub by end of today hopefully. Thanks for your contribution!

clausherther added a commit that referenced this pull request Jul 13, 2021
* 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>
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

Successfully merging this pull request may close these issues.

expect_column_values_to_be_in_set doesn't seem to be working
2 participants