Skip to content

Commit

Permalink
Get test_metadata optionally everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
jochemvandooren committed Dec 16, 2024
1 parent 05d7bf3 commit 6df3ba8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dbt_score/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def _get_columns(
[
test
for test in test_values
if test["test_metadata"]["kwargs"].get("column_name") == name
if test.get("test_metadata", {})
.get("kwargs", {})
.get("column_name")
== name
],
)
for name, values in node_values.get("columns", {}).items()
Expand Down Expand Up @@ -224,7 +227,9 @@ def from_node(
tests=[
Test.from_node(test)
for test in test_values
if not test["test_metadata"]["kwargs"].get("column_name")
if not test.get("test_metadata", {})
.get("kwargs", {})
.get("column_name")
],
depends_on=node_values["depends_on"],
_raw_values=node_values,
Expand Down

0 comments on commit 6df3ba8

Please sign in to comment.