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
If a node refs a versioned model but does not specify a version, the ref will use the latest version. But if a new latest version is added to the ref'd model and nothing changes in the model with the ref, the depends_on unique_id will not be updated.
Create a test case for this situation and update the code in core/dbt/parser/manifest.py "process_refs". We could check for refs to versioned models or just process all refs (not just models with an updated "created_at" timestamp. Processing refs is pretty fast, though it might be useful to compare the time it takes to do it both ways.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Ensure process_refs is called for nodes referring to versioned models
[CT-2419] Ensure process_refs is called for nodes referring to versioned models
Apr 17, 2023
dbt run --select depends_on_version
23:36:59 Running with dbt=1.6.0-a1
23:37:00 Found 3 models, 0 tests, 0 snapshots, 0 analyses, 552 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics, 0 groups
23:37:00
23:37:02 Concurrency: 1 threads (target='dev')
23:37:02
23:37:02 1 of 1 START sql view model dbt_marky.depends_on_version ....................... [RUN]
23:37:02 1 of 1 ERROR creating sql view model dbt_marky.depends_on_version .............. [ERROR in 0.02s]
23:37:02
23:37:02 Finished running 1 view model in 0 hours 0 minutes and 1.85 seconds (1.85s).
23:37:02
23:37:02 Completed with 1 error and 0 warnings:
23:37:02
23:37:02 Compilation Error in model depends_on_version (models2/depends_on_version.sql)
23:37:02 dbt was unable to infer all dependencies for the model "depends_on_version".
23:37:02 This typically happens when ref() is placed within a conditional block.
23:37:02
23:37:02 To fix this, add the following hint to the top of the model "depends_on_version":
23:37:02
23:37:02 -- depends_on: {{ ref('my_model') }}
23:37:02
23:37:02 Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1
If a node refs a versioned model but does not specify a version, the ref will use the latest version. But if a new latest version is added to the ref'd model and nothing changes in the model with the ref, the depends_on unique_id will not be updated.
Create a test case for this situation and update the code in core/dbt/parser/manifest.py "process_refs". We could check for refs to versioned models or just process all refs (not just models with an updated "created_at" timestamp. Processing refs is pretty fast, though it might be useful to compare the time it takes to do it both ways.
The text was updated successfully, but these errors were encountered: