Skip to content

Commit

Permalink
init push arbitrary configs for generic tests pr
Browse files Browse the repository at this point in the history
  • Loading branch information
McKnight-42 committed May 30, 2024
1 parent 3e37d77 commit bc0dc73
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/dbt/parser/generic_test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,21 @@ def __init__(
self.config[key] = value

if "config" in self.args:
for key, value in self.args["config"].items():
if isinstance(value, str):

Check warning on line 161 in core/dbt/parser/generic_test_builders.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/generic_test_builders.py#L161

Added line #L161 was not covered by tests

try:
value = get_rendered(value, render_ctx, native=True)
except UndefinedMacroError as e:

Check warning on line 165 in core/dbt/parser/generic_test_builders.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/generic_test_builders.py#L163-L165

Added lines #L163 - L165 were not covered by tests

raise CustomMacroPopulatingConfigValueError(

Check warning on line 167 in core/dbt/parser/generic_test_builders.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/generic_test_builders.py#L167

Added line #L167 was not covered by tests
target_name=self.target.name,
column_name=column_name,
name=self.name,
key=key,
err_msg=e.msg,
)
self.config[key] = value

Check warning on line 174 in core/dbt/parser/generic_test_builders.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/generic_test_builders.py#L174

Added line #L174 was not covered by tests
del self.args["config"]

if self.namespace is not None:
Expand Down

0 comments on commit bc0dc73

Please sign in to comment.