Repository navigation
Commit 5b97619
table_function: enforce TState serializability unconditionally
The TState-must-extend-ArrowSerializableDataclass check in
__init_subclass__ was nested inside the FunctionArguments
auto-extraction branch, so any class that set FunctionArguments
explicitly in its body skipped TState validation entirely.
That let non-serializable state slip through. It appears to work on
subprocess transport (the worker process is long-lived, so the live
state object survives between process() ticks) but breaks on HTTP,
where each tick is an independent request and state must round-trip
through the stream-state token. A stateless worker that never advances
turns into an unbounded producer-exchange loop.
The projection_repro fixture's _ChunkedState was exactly this case: a
plain @DataClass(slots=True) used as TState, never validated because
the fixture sets FunctionArguments explicitly. Make it extend
ArrowSerializableDataclass so the framework threads it through the
stream-state token, and hoist the validation out of the hasattr guard
so it runs for every TableFunctionGenerator subclass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6a8d97c commit 5b97619
2 files changed
Lines changed: 44 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | | - | |
206 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
207 | 218 | | |
208 | 219 | | |
209 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
384 | 415 | | |
385 | 416 | | |
386 | 417 | | |
| |||
396 | 427 | | |
397 | 428 | | |
398 | 429 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 430 | | |
416 | 431 | | |
417 | 432 | | |
| |||
0 commit comments