Skip to content

Behavior flag to handle all warnings with warn_error logic #11483

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

Conversation

QMalcolm
Copy link
Contributor

Resolves #11116

Problem

Not all warnings are currently handled by warn_error. This is problematic, as our docs lead one to believe if they have --warn-error or --warn-error-options={'error': 'all'} that all warnings will become errors (docs). Unfortunately, we can't just make it such that all warnings are handled by the warn_error logic, as that means currently working projects which are using either of the flags I previously described would begin to fail.

Solution

Add a behavior flag require_all_warnings_handled_by_warn_error which, if set to True, will make it so all warnings are handled by warn_error logic. This is possible because of the work done in dbt-labs/dbt-common#259.

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.

By default the behavior flag is `False`. Users can set it to true in
their `dbt_project.yml`. Eventually the default for the behavior flag
will become `True`.
@QMalcolm QMalcolm requested a review from a team as a code owner April 10, 2025 16:27
@cla-bot cla-bot bot added the cla:yes label Apr 10, 2025
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.89%. Comparing base (e2e86b7) to head (de5cf76).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11483      +/-   ##
==========================================
- Coverage   88.91%   88.89%   -0.02%     
==========================================
  Files         194      194              
  Lines       24553    24556       +3     
==========================================
- Hits        21832    21830       -2     
- Misses       2721     2726       +5     
Flag Coverage Δ
integration 85.95% <100.00%> (-0.04%) ⬇️
unit 62.78% <100.00%> (+0.03%) ⬆️

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

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

@QMalcolm QMalcolm merged commit 3f56cbc into main Apr 11, 2025
64 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--11116-behavior-flag-to-handle-all-warnings-with-warn-error-logic branch April 11, 2025 18:12
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.

[Bug] --warn-error-options doesn't support configuration of turning source freshness warnings into failures
2 participants