-
Notifications
You must be signed in to change notification settings - Fork 49
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
postgreql safe data_quality__eligibility_death_flag #640
base: main
Are you sure you want to change the base?
postgreql safe data_quality__eligibility_death_flag #640
Conversation
…-dq-death-flag-check-postgresql-safe
…-dq-death-flag-check-postgresql-safe
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.
Hi @BuzzCutNorman, thanks for submitting this bug and fix! I have one suggested change to make this work in all of our supported data warehouses.
@@ -11,7 +11,7 @@ SELECT DISTINCT | |||
,'ELIGIBILITY' AS claim_type | |||
,'DEATH_FLAG' AS field_name | |||
,case | |||
when m.death_flag in (1,0) then 'valid' | |||
when m.death_flag in ('1','0') then 'valid' |
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.
This syntax does not work in all of our supported data warehouses. Casting the death_flag as a string first and then evaluating the values as strings does work.
when m.death_flag in ('1','0') then 'valid' | |
when cast(m.death_flag as {{ dbt.type_string() }}) in ('1','0') then 'valid' |
Workflow has finished with the following statuses:
|
Describe your changes
In the model
the_tuva_project.data_quality.dqi.intermediate.atomic_checks.claims.eligibility.data_quality__eligibility_death_flag
I changed the case statement to utilizein ('1', '0')
which is exceptable in postgresql. I believe it also to be allowed as a equivilant to the orginalin (1,0)
in the officially supported data warehouses.Closes #553
How has this been tested?
I created a branch with the chagnes locally. Pointed my project dbt packages.yml to install tuva from that local repositry and ran
dbt deps
then did adbt run --select the_tuva_project.data_quality.dqi.intermediate.atomic_checks.claims.eligibility.data_quality__eligibility_death_flag
which completed sucessfully. I then ran 'dbt run' which completed beyond thedata_quality__eligibility_death_flag
model.This will defenately need to be test against all supported datawarehouses. I didn't have access to the to test but did utilize documentation to if this code change would be equivilant to the orginal code.
Reviewer focus
in
data_quality__eligibility_death_flag.sql
please check the slight change to case statement in the select clause.Checklist before requesting a review
tuva_last_run
to the final outputPackage release checklist
dbt_project.yml
(Optional) Gif of how this PR makes you feel
Loom link