Commit Graph

2844 Commits

Author SHA1 Message Date
Xuanwo 9b46e7a448 feat: guard generated metadata on overwrite 2026-08-12 19:08:13 +08:00
Xuanwo 7a46da2e67 feat: guard generated metadata on add columns 2026-08-12 18:52:21 +08:00
Xuanwo 705f7e7760 feat: guard generated metadata on table creation 2026-08-12 18:41:58 +08:00
Xuanwo d38a566282 feat: reserve generated column metadata updates 2026-08-12 18:25:31 +08:00
Xuanwo 5a27c71ab8 feat: reject merge insert on generated columns 2026-08-12 18:12:30 +08:00
Xuanwo 76f6487d92 feat: invalidate generated columns on native delete 2026-08-12 17:57:26 +08:00
Xuanwo 6f6c3c33e0 build: pin Lance zero-row delete attachment fix 2026-08-12 17:31:34 +08:00
Xuanwo 1aa3665d67 feat: invalidate generated columns on native update 2026-08-12 17:03:31 +08:00
Xuanwo 0194f2317a build: pin Lance no-op update attachment fix 2026-08-12 16:44:38 +08:00
Xuanwo c2a647189d feat: invalidate generated columns on native append 2026-08-12 16:14:22 +08:00
Xuanwo df67ee4028 chore: pin Lance A4 substrate 2026-08-12 15:49:25 +08:00
Xuanwo d9e41228c8 feat: plan generated column invalidation 2026-08-12 15:11:25 +08:00
Xuanwo 68597070d2 feat: project remote query function errors 2026-08-12 14:49:01 +08:00
Xuanwo c825737780 feat: guard native generated column queries 2026-08-12 14:14:41 +08:00
Xuanwo 0a43795996 feat: add generated column query guard analysis 2026-08-12 13:45:13 +08:00
Xuanwo 0fa2fa05ad feat(python): expose generated column status 2026-08-12 12:52:27 +08:00
Xuanwo 93ba442ac2 feat: expose generated column status 2026-08-12 12:17:02 +08:00
Xuanwo 7a94ab7d6c feat: add generated column Python API 2026-08-12 11:50:54 +08:00
Xuanwo 6ed1a25439 feat: submit generated column creation jobs 2026-08-12 10:58:04 +08:00
Xuanwo ca1d04db25 feat(python): bind function calls to table snapshots 2026-08-12 10:31:46 +08:00
Xuanwo efe3300404 feat: validate bound function call fields 2026-08-12 10:05:42 +08:00
Xuanwo ecf87f6371 feat: add atomic generated column binding snapshots 2026-08-12 09:49:51 +08:00
Xuanwo 47213e31f8 feat(python): add first-class function call authoring 2026-08-12 09:19:49 +08:00
Xuanwo f65bf89c98 feat(python): add exact function revocation 2026-08-12 08:22:49 +08:00
Xuanwo d902144605 feat(rust): add exact function revocation 2026-08-12 08:06:30 +08:00
Xuanwo a49dc5c71d feat(python): add conditional function name removal 2026-08-12 07:56:07 +08:00
Xuanwo 98fed41efa feat(rust): add conditional function name removal 2026-08-12 07:33:19 +08:00
Xuanwo 1524ee0669 feat(python): add conditional function replacement 2026-08-12 07:02:38 +08:00
Xuanwo 29be3e5509 feat(python): expose function job error codes 2026-08-12 06:44:03 +08:00
Xuanwo 8cedd50495 feat: expose function lookup in Python 2026-08-12 06:25:33 +08:00
Xuanwo b71ada0fae feat: add function catalog lookup 2026-08-12 06:06:18 +08:00
Xuanwo 206efd98ff feat: register functions from Python 2026-08-12 05:34:28 +08:00
Xuanwo 65c0968c0f feat: submit function registration jobs 2026-08-12 05:03:17 +08:00
Xuanwo 2b10f2a7ce feat: bridge Python UDF definitions to Rust 2026-08-12 04:34:58 +08:00
Xuanwo f8bb90405f feat: declare Python function capabilities 2026-08-12 03:57:52 +08:00
Xuanwo 76aac96749 feat: validate Python UDF source packages 2026-08-12 03:47:17 +08:00
Xuanwo 0093bc8179 feat: add Python UDF declarations 2026-08-12 03:28:05 +08:00
Xuanwo ac35a687f1 feat: expose Python function job results 2026-08-12 03:12:36 +08:00
Xuanwo 203f6536a6 feat: expose typed remote job results 2026-08-12 02:09:33 +08:00
Xuanwo 9d3d0d0640 feat: decode remote job results 2026-08-12 01:39:51 +08:00
Xuanwo a9ed8dba27 feat: return results from jobs 2026-08-12 01:18:41 +08:00
Xuanwo 04acf1d3b5 feat: add first-class function job result 2026-08-12 00:43:18 +08:00
Xuanwo 3746118374 feat: add generated column change job spec 2026-08-12 00:26:01 +08:00
Xuanwo d0b5cbe510 feat: add generated column refresh job spec 2026-08-12 00:09:57 +08:00
Xuanwo 7b195adc3a feat: add generated column create job spec 2026-08-11 23:44:27 +08:00
Xuanwo 818d6d1f59 feat: add function registration job spec 2026-08-11 23:26:05 +08:00
Xuanwo 9d589bea44 feat: add function definition contract 2026-08-11 23:11:01 +08:00
Xuanwo 1798ece362 feat: add stable function error codes 2026-08-11 22:43:39 +08:00
Xuanwo 82b82711ba feat: add first-class function value model 2026-08-11 22:25:09 +08:00
Sravan Avvaru a615306f39 feat(python): add on_transform_error fault tolerance to StreamingDataset (#3763)
Closes #3704

## Problem

Transforms can fail on bad data (e.g. nulls/NaNs from incomplete user
surveys). Today any transform exception aborts iteration, and there is
no way to skip invalid rows during loading.

## Solution

New `on_transform_error` parameter on `StreamingDataset`:

- `"raise"` (default, matches current behavior and the convention in
tf.data / WebDataset / Ray Data)
- `"skip"` — drop the failing rows and continue
- `"warn"` — like skip, plus a logged warning per failing batch
- a WebDataset-style callable `handler(exc) -> bool`, so users can skip
only expected error types

Key design points:

- **Row-granular skipping**: when a batch fails, the transform is re-run
on single-row slices so only the rows that actually fail are dropped
(avoids Ray-style whole-block loss). Skips are counted in a new
`rows_skipped` property.
- **No crash on uneven skips**: the round-robin loop now ends the epoch
at the last cycle where every split still has a row, instead of hitting
`IndexError` when a split runs dry early.
- **Exact resumability under skips**: checkpoints are now
position-based. `state_dict` gains `positions_consumed_per_split` (exact
for owned splits), and a new `merge_state_dicts` static method combines
per-rank states via elementwise max for elastic resume across topology
changes. Old checkpoints without the new key still load. Positions equal
sample counts when nothing is skipped, so existing behavior is
unchanged.
- **Guardrail**: transforms returning the wrong number of rows now raise
a clear `ValueError` instead of silently corrupting split accounting.

### Answers to the issue's open questions

- *Can we do this?* Yes — all transforms funnel through one guarded call
in the Stage 2 pipeline.
- *What do other libraries do?* tf.data `ignore_errors()`, WebDataset
`handler=`, Ray `max_errored_blocks`; MosaicML StreamingDataset offers
nothing (skipping conflicts with its determinism model). This design
follows the common conventions: raise by default, opt-in skipping,
count/log drops.
- *Error handling or pre-filtering?* Both: the existing `filter=`
remains the recommended tool for predictable bad data (splits are built
post-filter, so all guarantees hold — now documented);
`on_transform_error` covers failures not expressible as a predicate.
- *Impact on splits / elastic determinism?* Per-split sample sequences
stay deterministic (skips are data-dependent, not topology-dependent).
With unequal bad-row counts across splits the last few global steps of
an epoch can differ across topologies (bounded by the skew), which is
documented on the parameter. With equal counts per split, full
determinism is preserved — covered by a test.

## Testing

15 new tests in `test_elastic_dataloader.py` covering: default raise,
invalid values, uniform and uneven skips (including epoch-end
truncation), warn logging, selective callable handlers, wrong-row-count
guardrail, determinism across runs and across world sizes (1/2/3/4) with
skips, exact mid-epoch resume with skips on the same topology, elastic
resume via `merge_state_dicts` (ws=2 → ws=1), merge validation, and
backward-compat loading of old checkpoints.

Note: relying on CI for the test run — my local machine OOMs during the
final link of the native extension. The change itself is pure Python.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 09:22:06 -07:00