Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a9419af
test(dataflow): characterize widget trait order and merged_sd before …
paddymul Oct 4, 2026
c139170
test(server): failing tests for the stats policy, routing and probes …
paddymul Oct 4, 2026
8895d26
feat(server): stats policy, routing and probes, not wired (rows-first…
paddymul Oct 4, 2026
9b96220
test(xorq): failing tests for the xorq schema stats tier and its load…
paddymul Oct 4, 2026
7f56c20
feat(xorq): stats tier machinery and the xorq schema tier (rows-first…
paddymul Oct 4, 2026
f03532c
test(server): failing tests for bytes and source_kind validation in r…
paddymul Oct 4, 2026
21cd73e
test(dataflow): accept pandas 3's str dtype in the pandas characteriz…
paddymul Oct 4, 2026
a2cc7ce
fix(server): validate bytes and source_kind in resolve_stats_policy (…
paddymul Oct 4, 2026
1c89cfd
test(xorq): failing test for the schema tier overriding init_sd typin…
paddymul Oct 4, 2026
10d9d01
fix(xorq): schema tier leaves a skipped column's typing to init_sd (r…
paddymul Oct 4, 2026
9cac279
test(server): failing tests for the pandas and polars schema stats ti…
paddymul Oct 4, 2026
334b736
feat(server): pandas and polars schema stats tier (rows-first s2)
paddymul Oct 4, 2026
3fd6b5f
test(server): failing tests for the calibrated stats policy threshold…
paddymul Oct 4, 2026
d7ba7bd
test(server): failing tests for the stats wire format and whole-run s…
paddymul Oct 4, 2026
3eef709
feat(server): calibrate the stats policy thresholds from the phase-0 …
paddymul Oct 4, 2026
6bd63ed
test(server): failing tests for stats reuse, component_config and gen…
paddymul Oct 4, 2026
9bfebfb
feat(server): stats_request, stats_update and df_meta.stats on deferr…
paddymul Oct 4, 2026
1aa87c1
fix(server): sequence token on buckaroo_state_change so a stale initi…
paddymul Oct 6, 2026
d809e15
Merge remote-tracking branch 'origin/main' into feat/rowsfirst-s1-sta…
paddymul Oct 6, 2026
3d2ca4a
Merge branch 'feat/rowsfirst-s1-stats-tier-core' into feat/rowsfirst-…
paddymul Oct 6, 2026
45baf00
Merge feat/rowsfirst-s2-schema-tier-pandas-polars (with main) into fe…
paddymul Oct 6, 2026
5e06554
Merge origin/feat/rowsfirst-p31b-policy-calibration into p33 (stats p…
paddymul Oct 6, 2026
3247e02
test(server): failing tests for the stats policy on the wire and the …
paddymul Oct 4, 2026
9ca1033
test(server): failing tests for a scalar tier with inline delivery an…
paddymul Oct 4, 2026
ffd7862
feat(server): stats policy wire contract and handler plumbing (rows-f…
paddymul Oct 4, 2026
45314a4
test(server): failing tests for the sort and search guards and the se…
paddymul Oct 4, 2026
16fc68e
test(server): more failing tests for the sort guard and the searched …
paddymul Oct 5, 2026
d07a7f2
feat(server): sort and search guards for huge sources and a searched …
paddymul Oct 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions buckaroo/customizations/pd_stats_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ def _type(is_bool: bool, is_numeric: bool, is_float: bool,
return "obj"


def with_type(flags: dict) -> dict:
"""``flags``, the ``is_*`` keys a typing stat returns, plus the ``_type``
derived from them through the ``_type`` stat."""
return {**flags, '_type': _type(**{key.name: flags[key.name] for key in _type._stat_func.requires})}


def schema_stats(ser: pd.Series) -> dict:
"""The stats a column's dtype alone determines: ``dtype``, the ``is_*``
flags and ``_type``. ``typing_stats`` runs on a zero-row slice, so no value
is read, and ``memory_usage`` is left out because it measures the data.

An ``object`` column gives the typing nothing to go on, and pandas calls an
empty one a string, so every object column types as ``string`` here. Full
stats look at the values and may say ``obj``."""
flags = typing_stats(ser.iloc[:0])
del flags['memory_usage']
return with_type(flags)


# ============================================================
# Base Summary Stats (replaces DefaultSummaryStats ColAnalysis)
# ============================================================
Expand Down
23 changes: 17 additions & 6 deletions buckaroo/customizations/pl_stats_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from buckaroo.pluggable_analysis_framework.column_filters import is_numeric_not_bool

# Reused unchanged from pd_stats_v2 — operate on stat dict, not raw series
from buckaroo.customizations.pd_stats_v2 import (_type, computed_default_summary_stats, histogram, cleaning_gen_ops, BaseSummaryResult, NumericStatsResult, HistogramSeriesResult)
from buckaroo.customizations.pd_stats_v2 import (_type, computed_default_summary_stats, histogram, cleaning_gen_ops, with_type, BaseSummaryResult, NumericStatsResult, HistogramSeriesResult)


# ============================================================
Expand All @@ -44,16 +44,27 @@ def pl_orig_col_name(ser: RawSeries) -> Any:
'is_time': bool, 'is_decimal': bool, 'is_binary': bool, 'memory_usage': int})


@stat()
def pl_typing_stats(ser: RawSeries) -> PlTypingResult:
"""Compute dtype and type flags for a polars column."""
dt = ser.dtype
def pl_dtype_typing(dt: pl.DataType) -> dict:
"""dtype string and type flags for a polars dtype. Needs a schema only,
which is what ``pl_schema_stats`` has to go on."""
return {'dtype': str(dt), 'is_numeric': dt.is_numeric() and dt.base_type() is not pl.Decimal,
'is_integer': dt.is_integer(), 'is_float': dt.is_float(), 'is_bool': dt == pl.Boolean,
'is_datetime': dt.is_temporal() and dt not in (pl.Duration, pl.Time), 'is_timedelta': dt == pl.Duration,
'is_string': dt in (pl.Utf8, pl.String), 'is_categorical': dt == pl.Categorical or isinstance(dt, pl.Enum),
'is_period': False, 'is_interval': False, 'is_time': dt == pl.Time, 'is_decimal': dt.base_type() is pl.Decimal,
'is_binary': dt == pl.Binary, 'memory_usage': ser.estimated_size()}
'is_binary': dt == pl.Binary}


@stat()
def pl_typing_stats(ser: RawSeries) -> PlTypingResult:
"""Compute dtype and type flags for a polars column."""
return {**pl_dtype_typing(ser.dtype), 'memory_usage': ser.estimated_size()}


def pl_schema_stats(ser: pl.Series) -> dict:
"""The stats a polars column's dtype alone determines: ``dtype``, the
``is_*`` flags and ``_type``. Reads ``ser.dtype`` and no value."""
return with_type(pl_dtype_typing(ser.dtype))


# ============================================================
Expand Down
10 changes: 10 additions & 0 deletions buckaroo/customizations/xorq_stats_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ def _type(is_bool: bool, is_integer: bool, is_float: bool, is_datetime: bool, is
return "obj"


def schema_stats(dtype: str) -> dict:
"""The stats a column's dtype alone determines: ``dtype``, the ``is_*``
flags and ``_type``. This is what the xorq dataflow's schema tier
publishes, derived through the same stats the pipeline runs."""
flags = typing_stats(dtype)
return {"dtype": dtype, **flags, "_type": _type(
flags["is_bool"], flags["is_integer"], flags["is_float"], flags["is_datetime"],
flags["is_string"])}


# ============================================================
# Batched aggregates — one ibis.Expr each, folded into the batch query
# ============================================================
Expand Down
Loading
Loading