-
Notifications
You must be signed in to change notification settings - Fork 507
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
dbt v1 compat #453
Merged
Merged
dbt v1 compat #453
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b42e6f9
dbt 0.7.4 release (#441)
joellabes 77f537b
Merge branch 'main' into next/patch
joellabes 8b38a56
Regression: Correctly handle missing relations in get_column_values (…
joellabes 0859537
Add missing curlies
joellabes 0df84c3
what person wrote this code :/ (it was me)
joellabes 68b187f
wrap values in quotes
joellabes ef240c7
GOOD
joellabes 614a8fc
bigquery compat (they don't like except)
joellabes fd8dc17
Backport android url changes from #426 (#452)
joellabes db8a047
Update CHANGELOG.md
joellabes f367880
Merge branch 'main' into next/minor
joellabes f6b4e4c
Change require-dbt-version, update dbt_project.yml for integration te…
joellabes a5a0b2f
Upgrade python version in CI, improve drop relation integration test
joellabes 3cb69fb
Clarify version pinning
joellabes 77411a9
Drop support for release candidates of 1.0.0
joellabes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
12 changes: 12 additions & 0 deletions
12
integration_tests/data/sql/data_get_column_values_dropped.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
field | ||
a | ||
b | ||
c | ||
d | ||
e | ||
f | ||
g | ||
g | ||
g | ||
g | ||
g |
This file contains 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
This file contains 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
26 changes: 26 additions & 0 deletions
26
integration_tests/tests/sql/test_get_column_values_use_default.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
{% set column_values = dbt_utils.get_column_values(ref('data_get_column_values_dropped'), 'field', default=['y', 'z'], order_by="field") %} | ||
|
||
with expected as ( | ||
select {{ dbt_utils.safe_cast("'y'", dbt_utils.type_string()) }} as expected_column_value union all | ||
select {{ dbt_utils.safe_cast("'z'", dbt_utils.type_string()) }} as expected_column_value | ||
), | ||
|
||
actual as ( | ||
|
||
{% for val in column_values %} | ||
select {{ dbt_utils.safe_cast("'" ~ val ~ "'", dbt_utils.type_string()) }} as actual_column_value | ||
{% if not loop.last %} | ||
union all | ||
{% endif %} | ||
{% endfor %} | ||
), | ||
|
||
failures as ( | ||
select * from actual | ||
where actual.actual_column_value not in ( | ||
select expected.expected_column_value from expected | ||
) | ||
) | ||
|
||
select * from failures |
This file contains 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
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.
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.
If you know that this is a table, you could try something like (pseudo-code):