Skip to content
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

Fix exception type of run operation macro not found #11193

Merged

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Jan 7, 2025

Resolves #11192

Problem

Missing macro in run operation should raise user exception (UndefinedMacroError)

Solution

Raise UndefinedMacroError, same as is done during dbt compile when a model references a non-existent macro here: https://github.com/dbt-labs/dbt-common/blob/2253401254d0ef6b819415b6a2546de3e16e5d95/dbt_common/clients/jinja.py#L600

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 Jan 7, 2025
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.93%. Comparing base (1592987) to head (1ad9ca4).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11193   +/-   ##
=======================================
  Coverage   88.93%   88.93%           
=======================================
  Files         187      187           
  Lines       24059    24091   +32     
=======================================
+ Hits        21397    21426   +29     
- Misses       2662     2665    +3     
Flag Coverage Δ
integration 86.31% <100.00%> (+<0.01%) ⬆️
unit 62.41% <0.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
Unit Tests 62.41% <0.00%> (+<0.01%) ⬆️
Integration Tests 86.31% <100.00%> (+<0.01%) ⬆️

@MichelleArk MichelleArk marked this pull request as ready for review January 7, 2025 21:13
@MichelleArk MichelleArk requested a review from a team as a code owner January 7, 2025 21:13
@MichelleArk MichelleArk merged commit 57e279c into main Jan 8, 2025
55 of 56 checks passed
@MichelleArk MichelleArk deleted the fix-exception-type-of-run-operation-macro-not-found branch January 8, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing macro in run operation should raise user exception (UndefinedMacroError)
2 participants