Skip to content

feat(python): Update BytecodeParser opcode awareness for upcoming Python 3.14 #23782

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

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Jul 28, 2025

It's that time of year again, when Python comes up with new bytecode ops and starts preparing to drop a new release (in early October); got a 3.14rc environment running and went through the disassembler docs to understand the new opcodes 💭

Updates

This year's release primarily adds optimising specialisations of existing ops, and it appears sufficient to make only minor updates to RewrittenInstructions to handle everything.

For example, we can remap the following 3.14 instructions, then parse as normal:

"LOAD_FAST_BORROW" → "LOAD_FAST"
"LOAD_SMALL_INT" → "LOAD_CONST"

There is another small update for subscript access...
"BINARY_OP ([])" → "BINARY_SUBSCR"

...and another new op we can ignore:
"NOT_TAKEN"

Will keep an eye on the next release candidates, but so far this allows all BytecodeParser unit tests to pass 👍

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Jul 28, 2025
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.34%. Comparing base (4b309cf) to head (450d506).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/_utils/udfs.py 35.71% 7 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23782      +/-   ##
==========================================
- Coverage   81.35%   81.34%   -0.01%     
==========================================
  Files        1651     1651              
  Lines      224251   224261      +10     
  Branches     2862     2866       +4     
==========================================
- Hits       182439   182434       -5     
- Misses      41101    41115      +14     
- Partials      711      712       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@ritchie46 ritchie46 merged commit 0ce1155 into pola-rs:main Jul 28, 2025
17 checks passed
@alexander-beedie alexander-beedie deleted the bytecode-parser-py314 branch July 28, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants