-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature: test config parity #3257
Conversation
fe15a80
to
515031a
Compare
699defa
to
bfc472d
Compare
if isinstance(value, str): | ||
value = get_rendered(value, render_ctx) | ||
self.modifiers[key] = value | ||
value = get_rendered(value, render_ctx, native=True) |
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.
ah!
I'm wondering about the use of ResourceType.Test.... It applies in some cases to everything in a schema file, not just tests. I introduced a ParseFileType in the load_all_files branch. Perhaps we should straighten out the ambiguous use of 'tests' for all schema files things versus just tests. |
@gshank Could you say more about that? I just did a quick search for all the places |
@@ -303,15 +311,25 @@ def get_test_name(self) -> Tuple[str, str]: | |||
name = '{}_{}'.format(self.namespace, name) | |||
return get_nice_schema_test_name(name, self.target.name, self.args) | |||
|
|||
def construct_config(self) -> str: | |||
configs = ",".join([ | |||
f"{key}=" + (f"'{value}'" if isinstance(value, str) else str(value)) |
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.
@kwigley This is actually the line that fixed the Undefined
Jinja error, because I was accidentally passing the config down on line 329 as:
{{ config(severity = warn) }}
Instead of severity = 'warn'
, i.e. string literal. And, well, warn
is not a defined Jinja variable.
At the same time, we can't quote values that need to be non-string types (namely, enabled
is boolean). This is a pretty janky way of writing that, I'm sure there's a more pythonic / f-string-smart way to do it.
resolves #3252
resolves #3253
This PR makes it possible to:
dbt_project.yml
models/*.yml:
dbt_project.yml:
Differences from proposal in #3253
tests:
. I think that's okay.dbt_project.yml
. That's not the order I had originally envisioned, but again I think that's okay; it's up for debate which one is actually more generic / specific.Next issues
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.