You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev/notes/pycapsule_failure.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,5 +11,28 @@ Commit range `9b4f1442^..d629ced2` replaced the `Table` wrapper-based API with a
11
11
12
12
Prior to the refactor, callers could not pass arbitrary capsule-bearing objects to `SessionContext.read_table`; they first had to wrap them in `Table`/`RawTable`, which were only constructible through safe helpers that produced trusted capsules. The new auto-coercion path therefore widened the attack surface to unvalidated capsules, exposing the latent unsafety.
13
13
14
-
## Suggested Fixes
15
-
See the Suggested Tasks in the PR review comment for concrete follow-up work.
14
+
## Runtime failure after 91b90f44
15
+
Commit 91b90f44 changed :meth:`SessionContext.read_table` so that any object
16
+
exposing ``__datafusion_table_provider__`` is normalized through
17
+
``Table.from_table_provider_capsule`` before delegating to the Rust context.
18
+
【F:python/datafusion/context.py†L1189-L1198】 That helper now calls into the
19
+
private binding ``df_internal.catalog.RawTable.from_table_provider_capsule`` to
20
+
wrap the capsule, but the ``RawTable`` type exported from
21
+
``datafusion._internal`` does not currently expose such a constructor.
22
+
【F:python/datafusion/catalog.py†L176-L187】 At runtime the lookup therefore
23
+
raises ``AttributeError`` and prevents `examples/pycapsule_failure.py` from
24
+
running, regressing the original reproducer from a segfault into a hard failure.
25
+
26
+
## Suggested Tasks
27
+
1. Export a ``RawTable.from_table_provider_capsule`` constructor from the Rust
28
+
bindings and ensure it becomes available through
29
+
``datafusion._internal.catalog`` during the wheel build so that the Python
30
+
shim can locate it.
31
+
2. Add an integration test that imports ``datafusion._internal`` and asserts
0 commit comments