-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Regression] 1.9.pre lost the warning at the project level (i.e. start of the run) that notified users that a model depends on a now deprecated model #10833
Comments
This is a more reasonable scenario where this warning is helpful - 2 versions of foo, one is deprecated: # models/schema.yml
models:
- name: foo
latest_version: 2
versions:
- v: 1
deprecation_date: 1999-01-01 00:00:00.00+00:00
- v: 2 -- models/foo_v1.sql
select 1 id
-- models/foo_v2.sql
select 2 id
-- models/bar.sql
select * from {{ ref('foo', v=1) }} $ dbt run --no-partial-parse
07:23:55 Running with dbt=1.8.7
07:23:55 Registered adapter: postgres=1.8.2
07:23:55 [WARNING]: While compiling 'bar': Found a reference to foo.v1, which was deprecated on '1999-01-01T00:00:00+00:00'. A new version of 'foo' is available. Migrate now: {{ ref('my_dbt_project', 'foo', v='2') }}.
07:23:55 [WARNING]: Model foo.v1 has passed its deprecation date of 1999-01-01T00:00:00+00:00. This model should be disabled or removed.
07:23:55 Found 3 models, 417 macros
07:23:55
07:23:55 Concurrency: 4 threads (target='pg')
07:23:55
07:23:55 1 of 3 START sql table model public.foo_v1 ..................................... [RUN]
07:23:55 2 of 3 START sql table model public.foo_v2 ..................................... [RUN]
07:23:55 1 of 3 OK created sql table model public.foo_v1 ................................ [SELECT 1 in 0.06s]
07:23:55 2 of 3 OK created sql table model public.foo_v2 ................................ [SELECT 1 in 0.06s]
07:23:55 3 of 3 START sql table model public.bar ........................................ [RUN]
07:23:55 3 of 3 OK created sql table model public.bar ................................... [SELECT 1 in 0.02s]
07:23:55
07:23:55 Finished running 3 table models in 0 hours 0 minutes and 0.24 seconds (0.24s).
07:23:55
07:23:55 Completed successfully
07:23:55
07:23:55 Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3
$ dbt run --no-partial-parse
07:20:14 Running with dbt=1.9.0-b2
07:20:14 Registered adapter: postgres=1.9.0-b1
07:20:15 [WARNING]: Model foo.v1 has passed its deprecation date of 1999-01-01T00:00:00+00:00. This model should be disabled or removed.
07:20:15 Found 3 models, 424 macros
07:20:15
07:20:15 Concurrency: 4 threads (target='pg')
07:20:15
07:20:15 1 of 3 START sql table model public.foo_v1 ..................................... [RUN]
07:20:15 2 of 3 START sql table model public.foo_v2 ..................................... [RUN]
07:20:15 2 of 3 OK created sql table model public.foo_v2 ................................ [SELECT 1 in 0.07s]
07:20:15 1 of 3 OK created sql table model public.foo_v1 ................................ [SELECT 1 in 0.07s]
07:20:15 3 of 3 START sql table model public.bar ........................................ [RUN]
07:20:15 3 of 3 OK created sql table model public.bar ................................... [SELECT 1 in 0.02s]
07:20:15
07:20:15 Finished running 3 table models in 0 hours 0 minutes and 0.25 seconds (0.25s).
07:20:15
07:20:15 Completed successfully
07:20:15
07:20:15 Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 |
I believe this warning is currently issued by dbt-core/core/dbt/events/types.py Lines 841 to 860 in ef9abe6
|
This happened in the code changes in #10221, where it only checks currently deprecated models instead of all models. We should be able to fix it by looping through references to the deprecated model. |
Is this a regression in a recent version of dbt-core?
Current Behavior
Pre-1.9 (1.8, 1.7), dbt emitted a "project level" warning that a model was using a now deprecated model. This seems to have been removed in 1.9 (versionless in dbt Cloud).
Expected/Previous Behavior
Bring that warning back :)
Steps To Reproduce
Project setup:
Try running with 1.8:
Warning tells us that model
bar
is using a deprecatedfoo
:Swap over to 1.9 pre and run again:
Which is admittedly less helpful than before.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
Since dbt Cloud versionless is on pre - then dbt Cloud also lost this warning message. Though you can go back to 1.7 to get this warning message back:
The text was updated successfully, but these errors were encountered: