Stable cache keys: hash-seed-independent plans and a df_key option #78
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 237 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #78"
general
weight: 0.35
timkpaine
Description
Makes
cache()keys usable across processes and environments. Each commit is reviewable on its own.Plans no longer depend on
PYTHONHASHSEED.pushdown_combineandpushdown_pivotcaptured sets of column names in their IO-source closures. Cloudpickle writes a set in iteration order, and for strings that order depends on the hash seed, soLazyFrame.serialize()returned different bytes in each process.cache()derives its default key from those bytes, so a persistent cache missed on every new run for any frame that included one of these sources. The closures now hold a sorted tuple and a list. I checked every other IO-source closure in the package and found no other sets of strings. There's no regression test for this, because one would need a subprocess per hash seed for every IO source.New
df_keyoption oncache(). Even with stable ordering, the serialized plan of a frame built from Python IO sources includes the source file paths of its pickled closures (polars' ownregister_io_sourcewrapper among them). The default key therefore changes across machines, virtual environments and library upgrades.df_keylets the caller supply the frame's identity instead.order_byandpartition_colsare still part of the key, so caches with different layouts stay separate. The default behaviour is unchanged.Type of Change
Checklist
make lint-py,make lint-docs)make test)Tests
test_explicit_df_key_replaces_plan_identityandtest_explicit_df_key_still_separates_layoutscover the new option.