Skip to content

feat(types): canonical H2O column wrappers — top/bot/pearson_corr/std/__pow__#11

Closed
ser-vasilich wants to merge 1 commit into
RayforceDB:masterfrom
ser-vasilich:feat/canonical-h2o-column-wrappers
Closed

feat(types): canonical H2O column wrappers — top/bot/pearson_corr/std/__pow__#11
ser-vasilich wants to merge 1 commit into
RayforceDB:masterfrom
ser-vasilich:feat/canonical-h2o-column-wrappers

Conversation

@ser-vasilich
Copy link
Copy Markdown

Summary

Single commit (`c0d315c`) adding new Column methods needed for canonical H2O groupby coverage in rayforce-bench. 56 lines across 3 files — pure Python AST additions, no C/FFI changes.

New methods on `Column` / `AggregationMixin`

  • `Column("v3").top(n)` — n largest values per group, descending (canonical H2O q8)
  • `Column("v3").bot(n)` — n smallest values per group, ascending
  • `Column("v1").pearson_corr(Column("v2"))` — Pearson correlation (q9, with `** 2` second stage)
  • `Column("v3").std()` — sample stddev, ddof=1, matches polars/pandas (q6 stddev side)
  • `Column("v3") ** 2` (`pow` / `rpow`)

New `Operation` enum entries

`POW`, `STDDEV`, `PEARSON_CORR`, `TOP`, `BOT`.
`MEDIAN` and `DEVIATION` already existed (engine verbs `med` / `dev`).

Each wrapper is a 1-line `return Expression(Operation.X, self, …)` — relies only on the existing Expression-AST mechanism, no v2-specific dependencies.

Engine support

Verb names match engine opcodes landing in:

This PR is the Python surface; without the engine PRs above, the new methods compile but error at runtime with the engine's missing-op message.

Related

  • Earlier PR feat: v2 finalization + canonical H2O column wrappers #10 was closed — it bundled 42 commits of Karim's pre-existing v2 migration work alongside this single wrapper commit. Scope was wrong; v2 migration is independent work that should land separately. This re-PR is just our 1 commit on top of `master`.

Test plan

  • Cherry-picks cleanly onto `origin/master` (1.0.0 base) — no v2 dependency
  • Reviewer: against engine PR #202 + #203 checkout — `make check LOCAL=1` in rayforce-bench → `pass — 665/665`

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ser-vasilich
Copy link
Copy Markdown
Author

Closing — wrong base. Wrapper depends on v2 binding (feat/canonical-h2o-wrappers branch), but this PR targets master (v1.0.0). Will re-open against v2 once that branch is on origin.

@ser-vasilich ser-vasilich deleted the feat/canonical-h2o-column-wrappers branch May 15, 2026 20:43
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