Skip to content

Conversation

@venkaa28
Copy link
Contributor

@venkaa28 venkaa28 commented Feb 4, 2026

Resolves #

Updates the Python model parser to recognize and track dbt.config.meta_get() calls, extracting keys and default values for runtime use.

Note: Python models only support meta_get(), not meta_require() (unlike SQL models which have both).

What Changed

  • Parser Updates: Modified models.py to recognize dbt.meta_get() function calls
  • Key Tracking: Extracts meta keys and default values from meta_get() calls
  • Validation: Validates argument count (1-2 args required)
  • Context Passing: Passes meta_keys_used and meta_keys_defaults to runtime macro
  • Tests: Added 6 unit tests covering various meta_get scenarios

Backwards Compatibility

  • Fully backwards compatible - parser only tracks new function, doesn't break existing code
  • Old pattern (dbt.config.get('meta_key')) continues to be parsed (though it won't work at runtime)

Related PRs

  • dbt-adapters PR: Runtime macro that uses parsed meta keys
  • Fusion PR: Deprecation warnings for old pattern
  • dbt-autofix PR: Automatic migration tool

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.

@venkaa28 venkaa28 requested a review from a team as a code owner February 4, 2026 19:02
@cla-bot cla-bot bot added the cla:yes label Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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.

@github-actions github-actions bot added the community This PR is from a community member label Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.36%. Comparing base (7b9d75b) to head (6adce16).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12453      +/-   ##
==========================================
- Coverage   91.39%   91.36%   -0.04%     
==========================================
  Files         203      203              
  Lines       25405    25428      +23     
==========================================
+ Hits        23220    23232      +12     
- Misses       2185     2196      +11     
Flag Coverage Δ
integration 88.20% <37.50%> (-0.12%) ⬇️
unit 65.09% <100.00%> (+0.03%) ⬆️

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

Components Coverage Δ
Unit Tests 65.09% <100.00%> (+0.03%) ⬆️
Integration Tests 88.20% <37.50%> (-0.12%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MichelleArk pushed a commit that referenced this pull request Feb 5, 2026
…hon model internal configs #12454 (#12457)

* Add test asserting python model under the hood configs don't raise deprecations

* Stop raising deprecation warnings for internal python model configs

* Handle `meta_keys_defaults` and `meta_keys_used` in prep for #12453
@venkaa28 venkaa28 changed the title Add parser support for dbt.meta_get() in Python models Add parser support for dbt.config.meta_get() in Python models Feb 6, 2026
@venkaa28 venkaa28 force-pushed the ani/python_meta_get branch from 59a6840 to 536d4e8 Compare February 6, 2026 18:27
@venkaa28 venkaa28 force-pushed the ani/python_meta_get branch from 536d4e8 to 6adce16 Compare February 6, 2026 18:29
@colin-rogers-dbt colin-rogers-dbt merged commit a1865cb into main Feb 10, 2026
52 checks passed
@colin-rogers-dbt colin-rogers-dbt deleted the ani/python_meta_get branch February 10, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes community This PR is from a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants