Commit c4e7486
authored
Add PyCapsule Type Support and Type Hint Enhancements for AggregateUDF in DataFusion Python Bindings (#1277)
Added TypeGuard function _is_pycapsule() for lightweight PyCapsule type validation.
Introduced _PyCapsule proxy class for static typing compatibility in non-type-checking contexts.
Extended overloads in AggregateUDF.__init__ and AggregateUDF.udaf() to include AggregateUDFExportable | _PyCapsule argument types.
Added stricter constructor argument validation for callable accumulators.
Updated AggregateUDF.from_pycapsule() to support direct PyCapsule initialization.
Refactored Rust PyAggregateUDF::from_pycapsule() logic to delegate PyCapsule validation to a new helper function aggregate_udf_from_capsule() for cleaner handling.1 parent e97ed57 commit c4e7486
File tree
3 files changed
+82
-19
lines changed- python
- datafusion
- tests
- src
3 files changed
+82
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| |||
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
| 301 | + | |
294 | 302 | | |
295 | 303 | | |
296 | 304 | | |
| |||
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
302 | 331 | | |
303 | 332 | | |
304 | 333 | | |
| |||
308 | 337 | | |
309 | 338 | | |
310 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
311 | 352 | | |
312 | 353 | | |
313 | 354 | | |
| |||
351 | 392 | | |
352 | 393 | | |
353 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
354 | 403 | | |
355 | 404 | | |
356 | 405 | | |
| |||
471 | 520 | | |
472 | 521 | | |
473 | 522 | | |
474 | | - | |
| 523 | + | |
475 | 524 | | |
476 | 525 | | |
477 | 526 | | |
| |||
481 | 530 | | |
482 | 531 | | |
483 | 532 | | |
484 | | - | |
| 533 | + | |
485 | 534 | | |
486 | 535 | | |
487 | 536 | | |
488 | 537 | | |
489 | 538 | | |
490 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
491 | 546 | | |
492 | 547 | | |
493 | | - | |
| 548 | + | |
494 | 549 | | |
495 | 550 | | |
496 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
| |||
186 | 195 | | |
187 | 196 | | |
188 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 207 | + | |
| 208 | + | |
204 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| |||
0 commit comments