Skip to content

fix(serializers): accept frozendict operands in lazy type-encoder registry - #922

Merged
cofin merged 1 commit into
mainfrom
fix/builds-315
Nov 17, 2026
Merged

cofin merged 1 commit into
mainfrom
fix/builds-315

Conversation

@cofin

@cofin cofin commented Nov 17, 2026

Copy link
Copy Markdown
Member

Fixes the Python 3.15 mypyc wheel builds. The 3.15 type stubs add frozendict overloads to dict.__or__/__ror__. The lazy type-encoder registry overrides those methods with narrower signatures, so mypyc rejected them and every 3.15 wheel build failed before compiling.

  • Widen the merge operator overrides on the lazy encoder registry to accept and return any operand, matching how dict behaves at runtime (it returns NotImplemented for operands it doesn't handle).
  • Drop a now-unneeded type-ignore code on __ior__, which only existed because of the old __or__ signature mismatch.
  • No runtime behavior change: the registry still loads optional encoders before every merge.

…istry

Python 3.15 stubs add frozendict overloads to dict.__or__/__ror__, which made
the narrower _LazyTypeEncoders overrides fail mypyc type-checking and broke
every py3.15 mypyc wheel build.
@cofin
cofin merged commit 9cb163b into main Nov 17, 2026
12 checks passed
@cofin
cofin deleted the fix/builds-315 branch November 17, 2026 21:08
@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.63%. Comparing base (a4d10f0) to head (2d2fafc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #922   +/-   ##
=======================================
  Coverage   84.63%   84.63%           
=======================================
  Files         629      629           
  Lines      142408   142408           
  Branches    30808    30808           
=======================================
+ Hits       120530   120531    +1     
  Misses      15241    15241           
+ Partials     6637     6636    -1     
Flag Coverage Δ
cloud-adbc-storage 29.80% <100.00%> (ø)
integration 56.64% <100.00%> (-0.01%) ⬇️
mssql-db2 30.73% <100.00%> (ø)
mysql-mariadb-embedded 38.06% <100.00%> (-0.01%) ⬇️
oracle 30.11% <100.00%> (+<0.01%) ⬆️
postgres-cockroach 39.78% <100.00%> (-0.01%) ⬇️
py3.11 84.47% <100.00%> (+<0.01%) ⬆️
py3.12 84.48% <100.00%> (-0.01%) ⬇️
py3.13 84.48% <100.00%> (+<0.01%) ⬆️
py3.14 84.22% <100.00%> (-0.01%) ⬇️
unit 81.92% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
sqlspec/utils/serializers/_json.py 76.79% <100.00%> (+0.68%) ⬆️

... and 2 files with indirect coverage changes

🚀 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants