Skip to content

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

Open
ser-vasilich wants to merge 2 commits into
RayforceDB:rayforce2from
ser-vasilich:feat/canonical-h2o-column-wrappers-v2
Open

feat(types): canonical H2O column wrappers — top/bot/pearson_corr/std/__pow__#12
ser-vasilich wants to merge 2 commits into
RayforceDB:rayforce2from
ser-vasilich:feat/canonical-h2o-column-wrappers-v2

Conversation

@ser-vasilich
Copy link
Copy Markdown

Summary

Single commit on top of rayforce2 adding 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 per group, descending (canonical H2O q8)
  • Column("v3").bot(n) — n smallest 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.

Engine support

Verb names match engine opcodes landing in:

Test plan

  • Cherry-picks cleanly onto rayforce2
  • 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>
raypy_kdb.c uses getaddrinfo + struct addrinfo from <netdb.h>, which
glibc only exposes when _GNU_SOURCE (or _POSIX_C_SOURCE >= 200112L)
is set. Without it, -std=c17 -Werror build fails on Linux with
'incomplete type struct addrinfo'.
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