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

Set default values for enrichment toggles in project yaml #54

Closed
bill-warner opened this issue Dec 17, 2021 · 1 comment
Closed

Set default values for enrichment toggles in project yaml #54

bill-warner opened this issue Dec 17, 2021 · 1 comment
Labels
category:models Related to the models in the package. status:blocked Maintainers can't work on this right now. type:bug Bugs or weaknesses. The issue has to contain steps to reproduce.

Comments

@bill-warner
Copy link
Contributor

Issue

As of dbt v0.20, dbt started throwing warnings for tests associated with disabled models. An example of this was the page view enrichments models for Redshift. To mute the warning, the tests were set to be enabled using the same var used to enable the corresponding model:

- unique:
enabled: "{{ var('snowplow__enable_yauaa', false) and target.type in ['redshift', 'postgres'] | as_bool() }}"
- not_null:
enabled: "{{ var('snowplow__enable_yauaa', false) and target.type in ['redshift', 'postgres'] | as_bool() }}"

These vars were defined in the packages dbt_project.yml file but could be over written in the root projects dbt_project.yml. Unfortunately a bug in dbt (dbt-labs/dbt-core#3698) meant that the value defined in the packages project yml file was incorrectly taking precedence over the value in the root project when the var was used in a yml file such as the page_views_scratch.yml file outlined above.

As a workaround in 0.5.0, all default values for these enrichment flags were set in var call itself.

enabled=(var('snowplow__enable_iab', false) and target.type in ['redshift', 'postgres'] | as_bool())

This makes updating the default value a pain.

Solution

Once the underlying bug is fixed, revert to setting default values in the packages project file:

# Setting default values for 3 enrichments below throughout package rather than here
# Workaround for a bug (https://github.com/dbt-labs/dbt-core/issues/3698).
# TODO: Return to having default values here once fixed.
# snowplow__enable_iab: false
# snowplow__enable_ua: false
# snowplow__enable_yauaa: false

@github-actions github-actions bot removed the bug label Dec 7, 2022
@rlh1994 rlh1994 added status:blocked Maintainers can't work on this right now. type:bug Bugs or weaknesses. The issue has to contain steps to reproduce. category:models Related to the models in the package. labels Dec 13, 2022
@rlh1994
Copy link
Contributor

rlh1994 commented May 3, 2023

Update: this has been fixed in dbt 1.6.0-b1, but we'll wait for a full release of dbt 1.6.0 and also potentially wait for other reasons to upgrade the minimum required version before adding this back in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:models Related to the models in the package. status:blocked Maintainers can't work on this right now. type:bug Bugs or weaknesses. The issue has to contain steps to reproduce.
Projects
None yet
Development

No branches or pull requests

2 participants