Repository navigation
[bug] Keep cache keys stable across processes on Python 3.14 - #282
Merged
Merged
Conversation
PEP 649 attaches an auto-generated __annotate__ (and __annotate_func__) to every annotated class. ccflow's behavior token hashes class method bytecode, so it picked up the __annotate__ closure, whose cells are PYTHONHASHSEED-sensitive. That made the behavior token, and therefore cache keys, differ between processes. Skip __annotate__/__annotate_func__ in the behavior token. Annotations are already captured through other paths, so this is lossless for the cache contract. Add a regression test that injects __annotate__ so it runs on pre-3.14 interpreters. Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>
duckdb 2.0 removed fetchone() from the relation returned by Connection.query(). Switch to relation.fetchall() (duckdb's recommended replacement), which exists on both old and new duckdb and fully drains the result, so the shared connection stays usable for the next query. Validated against duckdb 2.0.0 and 1.4.0. Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>
ptomecek
force-pushed
the
bug/stable-cache-keys-py314-annotate
branch
from
October 22, 2026 17:57
16ad44c to
ef7a019
Compare
Contributor
Test Results 1 files ±0 1 suites ±0 1m 59s ⏱️ -20s Results for commit ef7a019. ± Comparison against base commit ea121bd. This pull request skips 4 and un-skips 1 tests.♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #282 +/- ##
==========================================
- Coverage 93.87% 93.84% -0.03%
==========================================
Files 202 202
Lines 22457 22469 +12
Branches 1457 1457
==========================================
+ Hits 21081 21086 +5
- Misses 1091 1096 +5
- Partials 285 287 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two small Python 3.14 / dependency compatibility fixes.
1. Stable cache keys across processes on Python 3.14. PEP 649 attaches an auto-generated
__annotate__(and__annotate_func__) to every annotated class. ccflow's cache-key machinery computes a behavior token by hashing class method bytecode, so it hashed the__annotate__closure, whose cells arePYTHONHASHSEED-sensitive. The behavior token, and the cache keys derived from it, then differed from one process to the next. Fix: add__annotate__/__annotate_func__to_SKIPPED_METHODSinccflow/utils/tokenize.py. Annotations are already captured through other paths, so excluding these is lossless for the cache contract. A regression test injects__annotate__manually so it also runs on pre-3.14 interpreters.2. duckdb 2.0 compatibility in the TPC-H example. duckdb 2.0 removed
fetchone()from the relation returned byConnection.query(). Switch torelation.fetchall()(duckdb's recommended replacement), which exists on both old and new duckdb and fully drains the result so the shared connection stays usable for the next query. Validated against duckdb 2.0.0 and 1.4.0.Type of Change
Checklist
make lint)make test)