Skip to content

fix(schema): support opt-in nested msgspec aliases - #924

Merged
cofin merged 2 commits into
mainfrom
fix/serializer-recursion
Nov 18, 2026
Merged

cofin merged 2 commits into
mainfrom
fix/serializer-recursion

Conversation

@cofin

@cofin cofin commented Nov 18, 2026

Copy link
Copy Markdown
Member

Summary

Nested SQL projections can return Python field names where msgspec expects encoded names. Add an explicit opt-in for trusted projections and prepare SQLSpec 0.72.1.

Key Changes

  • Add to_schema(..., normalize_nested=True) and document how to use it with raw result rows.
  • Update predicate pushdown for SQLGlot 30.33, preserve ASOF join semantics, and distinguish nested expression scopes in optimizer cache keys.
  • Refresh the dependency lockfile.

Closes #923.

@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.64%. Comparing base (9cb163b) to head (aa48bfa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sqlspec/builder/_base.py 63.63% 2 Missing and 2 partials ⚠️
sqlspec/utils/schema.py 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
+ Coverage   84.63%   84.64%   +0.01%     
==========================================
  Files         629      629              
  Lines      142408   142422      +14     
  Branches    30808    30813       +5     
==========================================
+ Hits       120531   120558      +27     
+ Misses      15242    15226      -16     
- Partials     6635     6638       +3     
Flag Coverage Δ
cloud-adbc-storage 29.80% <36.00%> (-0.01%) ⬇️
integration 56.63% <48.00%> (-0.01%) ⬇️
mssql-db2 30.72% <44.00%> (-0.01%) ⬇️
mysql-mariadb-embedded 38.06% <36.00%> (-0.01%) ⬇️
oracle 30.10% <44.00%> (-0.01%) ⬇️
postgres-cockroach 39.77% <48.00%> (+<0.01%) ⬆️
py3.11 84.48% <80.00%> (+0.01%) ⬆️
py3.12 84.49% <80.00%> (+0.01%) ⬆️
py3.13 84.49% <80.00%> (+0.01%) ⬆️
py3.14 84.23% <80.00%> (+<0.01%) ⬆️
unit 81.93% <80.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
sqlspec/core/hashing.py 84.61% <100.00%> (+0.15%) ⬆️
sqlspec/utils/schema.py 80.29% <91.66%> (+3.39%) ⬆️
sqlspec/builder/_base.py 85.25% <63.63%> (+0.07%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cofin
cofin merged commit bbd9e83 into main Nov 18, 2026
42 checks passed
@cofin
cofin deleted the fix/serializer-recursion branch November 18, 2026 04:53
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.

feat(schema): add opt-in recursive nested Struct field normalization to to_schema

2 participants