Skip to content

Commit 2b638fa

Browse files
fix: address CodeRabbit review comments
- Fix JSON parsing logic in _parse_model_owners to return [parsed] instead of [model_owners_value] when json.loads succeeds with a non-list value - Remove unused tmp_path parameter from all 4 test functions Co-Authored-By: Yosef Arbiv <[email protected]>
1 parent dcc5a60 commit 2b638fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

integration_tests/tests/test_dbt_artifacts/test_test_owners.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def _parse_model_owners(model_owners_value):
3535
return []
3636
try:
3737
parsed = json.loads(model_owners_value)
38-
return parsed if isinstance(parsed, list) else [model_owners_value]
38+
return parsed if isinstance(parsed, list) else [parsed]
3939
except json.JSONDecodeError:
4040
return [model_owners_value]
4141
return []
4242

4343

44-
def test_single_parent_test_owner_attribution(dbt_project: DbtProject, tmp_path):
44+
def test_single_parent_test_owner_attribution(dbt_project: DbtProject):
4545
"""
4646
Test that a test on a single model correctly inherits the owner from that model.
4747
This is the baseline case - single parent tests should have the parent's owner.
@@ -98,7 +98,7 @@ def test_single_parent_test_owner_attribution(dbt_project: DbtProject, tmp_path)
9898

9999
@pytest.mark.skip_targets(["dremio"])
100100
def test_relationship_test_uses_primary_model_owner_only(
101-
dbt_project: DbtProject, tmp_path
101+
dbt_project: DbtProject,
102102
):
103103
"""
104104
Test that a relationship test between two models with different owners
@@ -195,7 +195,7 @@ def test_relationship_test_uses_primary_model_owner_only(
195195

196196

197197
@pytest.mark.skip_targets(["dremio"])
198-
def test_relationship_test_no_owner_on_primary_model(dbt_project: DbtProject, tmp_path):
198+
def test_relationship_test_no_owner_on_primary_model(dbt_project: DbtProject):
199199
"""
200200
Test that when the primary model has no owner but the referenced model does,
201201
the test should have empty model_owners (not inherit from referenced model).
@@ -284,7 +284,7 @@ def test_relationship_test_no_owner_on_primary_model(dbt_project: DbtProject, tm
284284
), f"Expected model_owners to be empty (primary model has no owner), got {model_owners}. Referenced model owner '{referenced_owner}' should NOT be inherited."
285285

286286

287-
def test_owner_deduplication(dbt_project: DbtProject, tmp_path):
287+
def test_owner_deduplication(dbt_project: DbtProject):
288288
"""
289289
Test that duplicate owners in a model's owner field are deduplicated.
290290
For example, if owner is "Alice,Bob,Alice", the result should be ["Alice", "Bob"].

0 commit comments

Comments
 (0)