-
Notifications
You must be signed in to change notification settings - Fork 27
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
bug/renamed-columns #55
Changes from all commits
3da5d8f
0458eee
7106aec
23deae6
15cdce5
7d26cf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for creating this here as well! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
/* This test is to make sure the final columns produced are the same between versions. | ||
Only one test is needed since it will fetch all tables and all columns in each schema. | ||
!!! THIS TEST IS WRITTEN FOR BIGQUERY!!! */ | ||
{% if target.type == 'bigquery' %} | ||
with prod as ( | ||
select | ||
table_name, | ||
column_name, | ||
data_type | ||
from {{ target.schema }}_salesforce_prod.INFORMATION_SCHEMA.COLUMNS | ||
), | ||
|
||
dev as ( | ||
select | ||
table_name, | ||
column_name, | ||
data_type | ||
from {{ target.schema }}_salesforce_dev.INFORMATION_SCHEMA.COLUMNS | ||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final | ||
|
||
{% else %} | ||
{{ print('This is written to run on bigquery. If you need to run on another warehouse, add another version for that warehouse') }} | ||
|
||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
packages: | ||
- package: fivetran/salesforce_source | ||
version: [">=1.0.0", "<1.1.0"] | ||
version: [">=1.1.0", "<1.2.0"] |
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.
Would recommend adding a Under the Hood section, and a line for the consistency tests you created.