Skip to content

Commit 865d9df

Browse files
timsaucerclaude
andcommitted
docs(expr): restate to_bytes behavior when ctx is None
The previous docstring on Expr.to_bytes called out the no-ctx case ("Without ctx a default codec is used"). The pickle-support rewrite replaced the docstring with a description of what travels inside the bytes but dropped the sentence that answered the immediate question a reader has when they see the optional `ctx` parameter. Re-add a one-paragraph explanation: with `ctx`, encoding routes through the session's installed LogicalExtensionCodec — so `with_python_udf_inlining` takes effect; without `ctx`, the default codec is used (Python UDF inlining on, no user-installed extension codec). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fafefd0 commit 865d9df

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

python/datafusion/expr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,12 @@ def to_bytes(self, ctx: SessionContext | None = None) -> bytes:
439439
Use this — or :func:`pickle.dumps` — to send an expression to a
440440
worker process for distributed evaluation.
441441
442+
When ``ctx`` is supplied, encoding routes through that session's
443+
installed :class:`LogicalExtensionCodec` (so settings like
444+
:meth:`SessionContext.with_python_udf_inlining` take effect).
445+
When ``ctx`` is ``None``, the default codec is used (Python UDF
446+
inlining on, no user-installed extension codec).
447+
442448
Built-in functions and Python UDFs (scalar, aggregate, window)
443449
travel inside the returned bytes; the worker does not need to
444450
pre-register them. UDFs imported via the FFI capsule protocol

0 commit comments

Comments
 (0)