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

[#4272] Move validator keyword argument in jinja 'config.get' to after default #4297

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Nov 17, 2021

resolves #4273

Description

The context provider code was wrapping the 'config.get' call in Jinja so that a default in the code required specifying the 'default=" keyword. This moves the order of the get validator param to after default so it's not necessary to specify the keyword.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change

@cla-bot cla-bot bot added the cla:yes label Nov 17, 2021
@@ -3,6 +3,9 @@
### Features
- Avoid error when missing column in YAML description ([#4151](https://github.com/dbt-labs/dbt-core/issues/4151), [#4285](https://github.com/dbt-labs/dbt-core/pull/4285))

### Fixes
- Allow specifying default in Jinja config.get with default keyword ([#4273](https://github.com/dbt-labs/dbt-core/issues/4273), [#4297](https://github.com/dbt-labs/dbt-core/pull/4297))
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self to call out that this is technically a breaking change for anyone using config.get(arg1, arg2), and passing a validation function to arg2. I think that's a pretty small (or nonexistent) set of people

@gshank gshank merged commit aea23a4 into main Nov 17, 2021
@gshank gshank deleted the config_get_params branch November 17, 2021 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] config.get(config.field, default_value) not working properly?
3 participants