Commit 4296c5e
Correct three more claims in the extension bundle docs
`QueryPlannerExportable` said `session` is the
`datafusion.context.SessionContext` the planner is being installed on. It
is not. The capsule getters are called from Rust and receive the PyO3
context, so `isinstance(session, SessionContext)` is False -- while its
repr reads `datafusion.SessionContext`, because the pyclass declares
`module = "datafusion"`. It carries every capsule getter and
`__datafusion_codec_id__`, which is all the protocol needs, so the fix is
to say duck-type it rather than to change what is passed. The two bundle
hooks are the exception and do receive the wrapper, since `with_extensions`
dispatches them from Python; the ffi.md section on capsule getters now
draws the same distinction.
The `with_extensions` `Raises:` section listed ValueError for colliding
codec ids only. A getter returning a capsule of the wrong kind also raises
it -- `Expected name 'datafusion_query_planner' in PyCapsule, instead got
'datafusion_logical_extension_codec'` -- which
`test_with_extensions_rejects_bad_codec_capsule` already pins.
The `datafusion.extensions` module docstring said phase two runs the
planner hook "once per bundle". Once per bundle that implements it; a
bundle implements either hook or both.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 07792ad commit 4296c5e
3 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
605 | 613 | | |
606 | 614 | | |
607 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1915 | 1915 | | |
1916 | 1916 | | |
1917 | 1917 | | |
1918 | | - | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
1919 | 1923 | | |
1920 | 1924 | | |
1921 | 1925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
0 commit comments