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

Get country code refactor #42

Merged
merged 5 commits into from
Jun 3, 2023
Merged

Get country code refactor #42

merged 5 commits into from
Jun 3, 2023

Conversation

amittiwari1979
Copy link
Collaborator

Are you a current Census customer? No

What change(s) does this PR introduce?

  • Code refactor to use correlated subquery instead of long case statements in the compiled code.
  • Removed domain extension cleanup seed file as we felt it was making the macro too complex.
  • Removed redundant entries from seed file in integration data.
  • Updated is_personal_email macro to have 3 possible values. True in case domain is personal email, False, in case domain is not a personal email domain and NULL in case macro is not able to extract domain from the email. As we don't know the domain, it's more appropriate to set it as NULL.

Does this PR introduce a breaking change?

  • Yes (please provide change details below.)
  • No
    Users who were using is_personal_email will get the value as null. If they still want to continue with earlier behaviour, we have added a new param to the macro treat_null_as_false. If this value is set to true, then the null will be interpreted as false and the behaviour will be same as before.

Did you update the dbt_project.yml files with the version upgrade (using semantic versioning)? (In both the main project and integration_tests)

  • Yes

Is this PR in response to a previously created issue

Select which warehouses were used to test the PR

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (write name here)

Feedback

Thank you for contributing to a Census dbt package! You can give us feedback in the #tools-census channel of dbt Slack, or on the Operational Analytics Club Slack.

Copy link
Collaborator

@Stephen986 Stephen986 left a comment

Choose a reason for hiding this comment

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

Approved with some minor changes requested!

macros/get_country_code.sql Outdated Show resolved Hide resolved
dbt_project.yml Outdated Show resolved Hide resolved
integration_tests/dbt_project.yml Outdated Show resolved Hide resolved
@Stephen986
Copy link
Collaborator

Looks great!

@Stephen986 Stephen986 merged commit d941fe0 into main Jun 3, 2023
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.

3 participants