Repository navigation
Conversation
A test on a versioned model renders its model argument as ref('my_model', version='1'), and the model's unique_id ends with the version (model.my_project.my_model.v1). The primary model lookup handled neither, so such tests got no parent_model_unique_id and no model_owners. Capture the ref arguments (name and optional version/v) and match the parent whose unique_id ends with .<name>.v<version>; unversioned refs and sources behave as before.
Contributor
|
👋 @masukai |
masukai
had a problem deploying
to
elementary_test_env
October 20, 2026 11:35 — with
GitHub Actions
Failure
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1089.
For a test with more than one parent, the primary model is found from the test's
modelargument. A versioned model is rendered there asref('my_model', version='1'), and its unique_id ends with the version (model.my_project.my_model.v1). The current lookup handles neither, so such tests get noparent_model_unique_idand nomodel_owners.This change:
ref(...)(name, and an optionalversion=/v=), so a versioned ref is matched.<name>.v<version>; otherwise keeps the existing comparison with the last part of the unique_idUnversioned refs and sources behave as before. It only uses single-group
modules.re.findall, like the existing code.Tests
test_relationship_test_on_versioned_model_uses_primary_model_ownertointegration_tests/tests/test_dbt_artifacts/test_test_owners.py. It fails on master (parent_model_unique_idis None) and passes with this change.pytest test_dbt_artifacts/test_test_owners.py --target duckdb(dbt-core 1.12.6, dbt-duckdb 1.11.0): 5 passed.pre-commit runon the changed files: passed.The new test is skipped for dbt Fusion and Dremio, like the existing relationship owner test next to it.
I ran the integration tests on DuckDB only (our own warehouse is BigQuery, where I did not run them). The change is plain Jinja with no warehouse-specific SQL, so I expect the other targets to behave the same, and I'll look at the CI results for the other warehouses.
Summary by CodeRabbit
Bug Fixes
Tests