Commit 0450713
refactor: drop dead state from PythonFunctionScalarUDF
`input_fields: Vec<Field>` and `volatility: Volatility` were added to
the struct so the codec could read them on encode. Both were
redundant:
* `Signature` already carries the `Vec<DataType>` (via
`TypeSignature::Exact`) and `Volatility` — the constructor collapses
the incoming `Vec<Field>` to `DataType`s on its way into the
signature, so `Field`-level metadata (nullability, attached
metadata) is never propagated anywhere on the local side.
* On decode, `from_parts` runs that same collapse again. Sender's
`Signature` and receiver's `Signature` end up with the same
`DataType`s and the same `Volatility`. The reconstructed
`PythonFunctionScalarUDF` is functionally equivalent to the
original without preserving the input-side `Field`s.
Revert the struct to its original 4-field shape (`name`, `func`,
`signature`, `return_field`). The codec now derives the input
`DataType`s from `signature.type_signature` and reads volatility from
`signature.volatility`. Input fields are still serialized into the
cloudpickle payload (with synthesized `arg_i` names) so the wire
format is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c7f95ac commit 0450713
2 files changed
Lines changed: 32 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
363 | 368 | | |
364 | 369 | | |
365 | 370 | | |
366 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
367 | 386 | | |
368 | 387 | | |
369 | 388 | | |
| |||
372 | 391 | | |
373 | 392 | | |
374 | 393 | | |
375 | | - | |
| 394 | + | |
376 | 395 | | |
377 | 396 | | |
378 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | 49 | | |
52 | | - | |
| 50 | + | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
69 | | - | |
70 | 66 | | |
71 | | - | |
| 67 | + | |
72 | 68 | | |
73 | 69 | | |
74 | 70 | | |
| |||
78 | 74 | | |
79 | 75 | | |
80 | 76 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 77 | | |
86 | 78 | | |
87 | 79 | | |
88 | 80 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
| |||
0 commit comments