Commit c0cf95a
committed
ALPRD: assert patch dtype instead of casting; drop execution context
ALPRD patch values are always stored as the non-nullable left-parts dtype, so
the runtime cast in `canonicalize_patches` (which required an `ExecutionCtx`
to materialise a lazy cast and an `all_valid` check) was unnecessary.
- Replace `ALPRDData::canonicalize_patches(left_parts, patches, ctx)` with a
ctx-free `validate_patches(left_parts, patches)` that asserts the patch
values already have the non-nullable left-parts dtype (a non-nullable dtype
also guarantees the values contain no nulls, so no `all_valid` execution is
needed). Resolves the `TODO(ngates)/TODO(joe): assert the DType, don't cast`.
- `validate_parts` likewise asserts the exact non-nullable patch dtype instead
of `eq_ignore_nullability` + an `all_valid(LEGACY_SESSION)` execution.
- `deserialize` no longer mints a `LEGACY_SESSION` ctx for patch handling.
- `take`: `Patches::take` ignores null indices but reports a nullable dtype;
drop the spurious nullability with a lazy `cast_values` (no execution at
construction) so the patch values satisfy the non-nullable invariant.
Net: removes 3 `LEGACY_SESSION` uses from ALPRD construction/validation. ALP
already asserts its patch dtype (its patch values are the original floats), so
no change was needed there.
Signed-off-by: Robert <robert@spiraldb.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mkrgj5SuJpaKBXK9jydtSc1 parent 7635ae6 commit c0cf95a
2 files changed
Lines changed: 29 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | 24 | | |
27 | | - | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
210 | 207 | | |
211 | 208 | | |
212 | 209 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 210 | + | |
220 | 211 | | |
221 | 212 | | |
222 | 213 | | |
| |||
372 | 363 | | |
373 | 364 | | |
374 | 365 | | |
375 | | - | |
376 | | - | |
| 366 | + | |
377 | 367 | | |
378 | 368 | | |
379 | 369 | | |
| |||
404 | 394 | | |
405 | 395 | | |
406 | 396 | | |
407 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
408 | 405 | | |
409 | 406 | | |
410 | | - | |
411 | 407 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
427 | 418 | | |
428 | 419 | | |
429 | 420 | | |
| |||
552 | 543 | | |
553 | 544 | | |
554 | 545 | | |
| 546 | + | |
555 | 547 | | |
556 | | - | |
557 | | - | |
| 548 | + | |
| 549 | + | |
558 | 550 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
| 551 | + | |
567 | 552 | | |
568 | 553 | | |
569 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
0 commit comments