You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ dbt deps
14:10:31 Running with dbt=1.6.0
14:10:31 Installing mypkg
14:10:31 Installed from <local @ mypkg>
$ dbt --no-partial-parse parse
14:10:43 Running with dbt=1.6.0
14:10:43 Registered adapter: postgres=1.6.0
14:10:44 Encountered an error:
Compilation Error
When referencing 'model_a', dbt found nodes in multiple packages: 'model.my_dbt_project.model_a', 'model.mypkg.model_a'
To fix this, use two-argument 'ref', with the package name first: 'my_dbt_project' or 'mypkg'
Remove the unique tests, then parse again (this time successfully):
github-actionsbot
changed the title
[Bug] Ambiguous reference error for tests when model name is duplicated across packages
[CT-2944] [Bug] Ambiguous reference error for tests when model name is duplicated across packages
Aug 6, 2023
I'm seeing this bug coming up more frequently, because of a change related to the dbt Core v1.6 ←→ MetricFlow integration. each project/package that defines semantic_models and metrics also needs to define a model named metricflow_time_spine. This leads to multiple installations of metricflow_time_spine (from packages + root project), and if any of those packages defines a test on metricflow_time_spine (e.g.), it raises this error message.
Is this a new bug in dbt-core?
Current Behavior
When:
dbt raises an ambiguous reference error
Expected Behavior
dbt should successfully parse my project, and resolve tests to reference the model in the same project/package where they are defined
Steps To Reproduce
Create a project named
my_dbt_project
, and another local project under a subdirectory namedmypkg/
.Within the root project:
Within the package
mypkg
, add the exact same model with the exact same config:From the root project:
Remove the
unique
tests, then parse again (this time successfully):Environment
Which database adapter are you using with dbt?
any
Additional Context
I believe this is a bug in v1.6, insofar as it falls under the intended scope of:
And was missed by the implementation in:
The text was updated successfully, but these errors were encountered: