Skip to content

Commit 1300076

Browse files
timsaucerclaude
andcommitted
fix(ipc): doctest collection failure on module docstring
`>>> # doctest: +SKIP` on its own line is not valid — doctest directives must attach to an example line. CI runs `pytest --doctest-modules` and `pyproject.toml` includes `python/datafusion` in testpaths, so the bad directive aborted collection across every Python version. Replace the two illustrative `>>>` blocks with `.. code-block:: python` since they were never meant to execute under doctest. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8130ab2 commit 1300076

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

python/datafusion/ipc.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
the shipped expression — install a configured :class:`SessionContext`
2626
once per worker:
2727
28-
>>> # doctest: +SKIP
29-
>>> from datafusion import SessionContext
30-
>>> from datafusion.ipc import set_worker_ctx
31-
>>>
32-
>>> def init_worker():
33-
... ctx = SessionContext()
34-
... ctx.register_udaf(my_ffi_aggregate)
35-
... set_worker_ctx(ctx)
28+
.. code-block:: python
29+
30+
from datafusion import SessionContext
31+
from datafusion.ipc import set_worker_ctx
32+
33+
def init_worker():
34+
ctx = SessionContext()
35+
ctx.register_udaf(my_ffi_aggregate)
36+
set_worker_ctx(ctx)
3637
3738
Built-in functions and Python UDFs (scalar, aggregate, window) travel
3839
inside the shipped expression itself and do not need pre-registration
@@ -43,13 +44,14 @@
4344
:meth:`SessionContext.with_python_udf_inlining` to every pickled
4445
expression on this thread:
4546
46-
>>> # doctest: +SKIP
47-
>>> from datafusion import SessionContext
48-
>>> from datafusion.ipc import set_sender_ctx
49-
>>>
50-
>>> driver_ctx = SessionContext().with_python_udf_inlining(False)
51-
>>> set_sender_ctx(driver_ctx)
52-
>>> pickle.dumps(expr) # encoded with inlining disabled
47+
.. code-block:: python
48+
49+
from datafusion import SessionContext
50+
from datafusion.ipc import set_sender_ctx
51+
52+
driver_ctx = SessionContext().with_python_udf_inlining(False)
53+
set_sender_ctx(driver_ctx)
54+
pickle.dumps(expr) # encoded with inlining disabled
5355
5456
Without a sender context the default codec is used (Python UDF
5557
inlining on). The sender context only affects pickle / ``to_bytes``

0 commit comments

Comments
 (0)