allow expressions in group_by of expect_grouped_row_values_to_have_re…#42
Open
ssuhre wants to merge 1 commit into
Open
allow expressions in group_by of expect_grouped_row_values_to_have_re…#42ssuhre wants to merge 1 commit into
ssuhre wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
To allow expressions like
JSON_VALUE(json_col.field)in group_by columns in the expect_grouped_row_values_to_have_recent_data test, the first occurrence of group_by columns is aliase. Later references then use this alias.Why Do We Need These Changes
Some of our models make use of JSON type columns.
Information inside the JSON is needed to determine groups which should have recent data.
This PR avoids unpacking the JSON into further columns within the same model or even creating a downstream model just to test on.
Reviewers
@GuruM
Notes
I ran the integration_tests project and tested our use case with a local installation of dbt-expectations.
If you need further info or changes, let me know.