Commit 90705a6
refactor(udf): add _from_internal classmethod to UDF wrappers
`SessionContext.udf` / `udaf` / `udwf` previously constructed wrapper
objects by calling `__new__` directly and writing the private `_udf`
/ `_udaf` / `_udwf` attribute from outside the owning module. Three
near-identical blocks coupled `context.py` to wrapper internals.
Add a `_from_internal` classmethod on each wrapper that takes an
already-constructed `df_internal` handle and returns a wrapper
without re-running `__init__`. The lookup methods now collapse to a
single call, the `__new__` bypass is documented on the wrapper class
itself, and renaming the private field is a one-spot edit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3bdca9e commit 90705a6
2 files changed
Lines changed: 39 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1354 | 1354 | | |
1355 | 1355 | | |
1356 | 1356 | | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
| 1357 | + | |
1360 | 1358 | | |
1361 | 1359 | | |
1362 | 1360 | | |
| |||
1387 | 1385 | | |
1388 | 1386 | | |
1389 | 1387 | | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
| 1388 | + | |
1393 | 1389 | | |
1394 | 1390 | | |
1395 | 1391 | | |
| |||
1418 | 1414 | | |
1419 | 1415 | | |
1420 | 1416 | | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
| 1417 | + | |
1424 | 1418 | | |
1425 | 1419 | | |
1426 | 1420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
| |||
453 | 465 | | |
454 | 466 | | |
455 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
456 | 480 | | |
457 | 481 | | |
458 | 482 | | |
| |||
873 | 897 | | |
874 | 898 | | |
875 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
876 | 912 | | |
877 | 913 | | |
878 | 914 | | |
| |||
0 commit comments