Skip to content

fix: populate model constraints regardless of contract enforcement#12710

Draft
MichelleArk wants to merge 2 commits into
main_backupfrom
populate-model-constraints
Draft

fix: populate model constraints regardless of contract enforcement#12710
MichelleArk wants to merge 2 commits into
main_backupfrom
populate-model-constraints

Conversation

@MichelleArk
Copy link
Copy Markdown
Contributor

Resolves #10219

Problem

Solution

When contract.enforced is false, model-level constraints are now
serialized to node.constraints as expected. Invalid constraint types
are filtered out silently (rather than causing a mashumaro error)
when the contract is not enforced.

Adds functional tests covering constraints with enforced: false,
no contract config, and no columns defined.

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.

  When contract.enforced is false, model-level constraints are now
  serialized to node.constraints as expected. Invalid constraint types
  are filtered out silently (rather than causing a mashumaro error)
  when the contract is not enforced.

  Adds functional tests covering constraints with enforced: false,
  no contract config, and no columns defined.

  Fixes #10219
@cla-bot cla-bot Bot added the cla:yes label Mar 25, 2026
@github-actions
Copy link
Copy Markdown
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
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.25%. Comparing base (f474171) to head (baae080).
⚠️ Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12710      +/-   ##
==========================================
- Coverage   91.38%   91.25%   -0.13%     
==========================================
  Files         203      203              
  Lines       25792    25942     +150     
==========================================
+ Hits        23569    23673     +104     
- Misses       2223     2269      +46     
Flag Coverage Δ
integration 88.05% <62.50%> (-0.15%) ⬇️
unit 65.46% <62.50%> (-0.01%) ⬇️

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

Components Coverage Δ
Unit Tests 65.46% <62.50%> (-0.01%) ⬇️
Integration Tests 88.05% <62.50%> (-0.15%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Feature] populate model['constraints'] even if the contract is not enforced

1 participant