Skip to content

Conversation

@MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Jul 31, 2025

Problem

Currently the following model definition:

models:
  - name: models_trivial
    description: "This is a test model"
    access: public

raises a CustomTopLevelKeyDeprecation - which is misleading because access is not 'custom' to the user - it's an accepted config part of the dbt framework. dbt-autofix reports fixing this issue as fixing PropertyMovedToConfigDeprecation as well.

Solution

Check if a field is a valid config prior and raising the more appropriate PropertyMovedToConfigDeprecation if it is.
Finding what valid fields are based on the schema was a little challenging to get right since we have many levels of nesting and fields with config! (e.g. sources, tables, columns)

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Jul 31, 2025
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@codecov
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.87%. Comparing base (b1705fb) to head (82cb8ca).
⚠️ Report is 2 commits behind head on main.

❌ Your patch status has failed because the patch coverage (8.69%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11879      +/-   ##
==========================================
- Coverage   91.91%   91.87%   -0.05%     
==========================================
  Files         199      199              
  Lines       24347    24368      +21     
==========================================
+ Hits        22379    22387       +8     
- Misses       1968     1981      +13     
Flag Coverage Δ
integration 88.73% <86.95%> (-0.13%) ⬇️
unit 65.26% <8.69%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 65.26% <8.69%> (-0.06%) ⬇️
Integration Tests 88.73% <86.95%> (-0.13%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MichelleArk MichelleArk force-pushed the more-accurate-deprecation-type branch from aa7ccde to 481e4b6 Compare July 31, 2025 14:48
@MichelleArk MichelleArk changed the title raise property-moved-to-config deprecation when additional field is a… Raise PropertyMovedToConfigDeprecation instead of CustomTopLevelKeyDeprecation when additional attribute is a valid config Jul 31, 2025
@MichelleArk MichelleArk marked this pull request as ready for review July 31, 2025 21:04
@MichelleArk MichelleArk requested a review from a team as a code owner July 31, 2025 21:04
@MichelleArk MichelleArk merged commit d27232a into main Aug 5, 2025
61 of 64 checks passed
@MichelleArk MichelleArk deleted the more-accurate-deprecation-type branch August 5, 2025 13:57
@MichelleArk MichelleArk added the backport 1.10.latest Tag for PR to be backported to the 1.10.latest branch label Aug 5, 2025
github-actions bot pushed a commit that referenced this pull request Aug 5, 2025
…precation when additional attribute is a valid config (#11879)

(cherry picked from commit d27232a)
colin-rogers-dbt pushed a commit that referenced this pull request Aug 6, 2025
…precation when additional attribute is a valid config (#11879) (#11893)

(cherry picked from commit d27232a)

Co-authored-by: Michelle Ark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 1.10.latest Tag for PR to be backported to the 1.10.latest branch cla:yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants