Skip to content

refactor!: method-form census - free functions move into their types - #425

Merged
ihb2032 merged 4 commits into
mainfrom
refactor/method-form
Sep 26, 2026
Merged

ihb2032 merged 4 commits into
mainfrom
refactor/method-form

Conversation

@ihb2032

@ihb2032 ihb2032 commented Sep 26, 2026

Copy link
Copy Markdown
Owner

The free-function-to-method census lands: 49 functions whose first argument is a type defined in the same package (method coherence pins a method to its type's package) become methods, in four focused commits.

  • lazy: the plan walk / execute / render / optimize verbs become LogicalPlan, FrameOp and ScanSource methods (all private, mbti unchanged).
  • series + frame: the engine seams (row gather / slice, validity read, coalesce, backend convergence, reduction dispatch, sort keys) become Series / SortKey methods, and DataFrame::filter_row_indices follows; engine_seams.snapshot regenerated, callers in frame / internal/kernel / io switch to dot syntax.
  • frame (breaking): the six column selectors become DataFrame methods - df.select(df.numeric_cols()) instead of df.select(numeric_cols(df)) - riding the open v0.7 window; facade re-exports removed, facade_surface.snapshot regenerated, migration guide updated.
  • misc: private helpers (render/format, join key resolvers, row-rebuild skeletons, leftmost-name walk, CmpVerb comparison primitives) become methods of their types.

1434 tests green, coverage fully covered, all guards pass (version identity, stale names, enum/facade/engine-seam/internal surfaces, layering, comment references, array copy boundaries).

…methods of LogicalPlan, FrameOp and ScanSource
The column verbs the engine layers above read - row gather / slice, the
validity-mask read, the mask-to-row-indices read, the two-column coalesce,
backend convergence, reduction dispatch, sort-key building - move from
free functions to Series methods, and the single-key comparator to a
SortKey method. DataFrame::filter_row_indices follows the same move on the
frame side. Method coherence puts them in series / frame where the types
live; the callers in frame, internal/kernel and io switch from bare or
qualified free-function calls to dot syntax, and the two using-import
binding lists shrink to what is not a method.
numeric_cols, cols_of_dtype, cols_matching, cols_starts_with,
cols_ends_with and cols_contains move from free functions (re-exported
through the root facade) to DataFrame methods, so the frame appears once
at the call site: df.select(df.numeric_cols()) instead of
df.select(numeric_cols(df)). The free-function spellings and their
facade re-exports are gone - a v0.7 break, documented in the migration
guide.
The one-off private helpers whose first argument is the value they work
on - the frame render/format helpers, the join key resolvers on
JoinOptions, the series row-rebuild skeletons, ExprNode's leftmost-name
walk, and the CmpVerb comparison primitives (apply_cmp included, which
the census missed as a generic) - move from free functions to methods.
@ihb2032
ihb2032 merged commit 025004d into main Sep 26, 2026
3 checks passed
@ihb2032
ihb2032 deleted the refactor/method-form branch September 26, 2026 08:05
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.

1 participant