Skip to content

fix(python): Support Python 3.15 expression dispatch - #28750

Closed
LarryHu0217 wants to merge 5 commits into
pola-rs:mainfrom
LarryHu0217:codex/fix-python-315-expr-dispatch-28347
Closed

LarryHu0217 wants to merge 5 commits into
pola-rs:mainfrom
LarryHu0217:codex/fix-python-315-expr-dispatch-28347

Conversation

@LarryHu0217

@LarryHu0217 LarryHu0217 commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix Python 3.15 expression dispatch behavior and add regression coverage for the affected code path.

Changes

  • Update expression dispatch to work correctly with Python 3.15.
  • Add regression tests covering the affected behavior.
  • Keep the change scoped to the dispatch issue without changing unrelated behavior.

Testing

I ran the full test suite locally with:

make test

Result:

  • 18,476 passed
  • 91 skipped
  • 9 xfailed

The screenshot is already attached
Screenshot 2026-08-09 at 1 56 44 PM

AI use

  1. I used AI to assist with investigating the Python 3.15 expression-dispatch issue and with drafting/refining parts of the implementation and regression tests.
  2. I confirm that I have reviewed all changes myself, and I believe they are relevant and correct.

Closes #28347

@codecov

codecov Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.69%. Comparing base (4a3aa4c) to head (b9df839).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28750      +/-   ##
==========================================
+ Coverage   81.67%   81.69%   +0.01%     
==========================================
  Files        1905     1905              
  Lines      271217   271216       -1     
  Branches     3105     3105              
==========================================
+ Hits       221527   221580      +53     
+ Misses      48907    48853      -54     
  Partials      783      783              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LarryHu0217 LarryHu0217 changed the title fix(python): support Python 3.15 expression dispatch fix(python): Support Python 3.15 expression dispatch Aug 9, 2026
@LarryHu0217

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-08-09 at 1 56 44 PM

@LarryHu0217

Copy link
Copy Markdown
Contributor Author

Hi, this is ready for review. The full local test suite passed, and the required screenshot is attached. Please let me know if any changes or additional validation would be helpful.

@LarryHu0217
LarryHu0217 force-pushed the codex/fix-python-315-expr-dispatch-28347 branch from 8ad3c52 to e3e7cad Compare August 20, 2026 20:55
@lukeshingles

Copy link
Copy Markdown
Contributor

CPython 3.15 has been ABI stable since rc1 on August 4th and the final release is due on October 1st. It would be good to get this merged before the final release of 3.15

return (fc.co_code in _EMPTY_BYTECODE) and (
(len(fc.co_consts) == 2 and fc.co_consts[1] is None)
# account for optimized-out docstrings (eg: running 'python -OO')
or (sys.flags.optimize == 2 and fc.co_consts == (None,))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was (sys.flags.optimize == 2 and fc.co_consts == (None,)) condition removed? could we restore this if it was accidental?

@nameexhaustion

Copy link
Copy Markdown
Collaborator

superceded by #29489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix python Related to Python Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pl.DataFrame fails on datetime.datetime in 3.15 Betas

3 participants