Skip to content

Commit 8a22df1

Browse files
timsaucerclaude
andcommitted
refactor(expr): drop redundant bytes(...) wrap in to_bytes
`PyExpr::to_bytes` returns `Bound<PyBytes>`, which crosses the FFI boundary as Python `bytes`. The defensive `bytes(...)` wrap was a no-op. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ca2f0ff commit 8a22df1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/datafusion/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def to_bytes(self, ctx: SessionContext | None = None) -> bytes:
446446
:doc:`/user-guide/io/distributing_work`.
447447
"""
448448
ctx_arg = ctx.ctx if ctx is not None else None
449-
return bytes(self.expr.to_bytes(ctx_arg))
449+
return self.expr.to_bytes(ctx_arg)
450450

451451
@classmethod
452452
def from_bytes(cls, buf: bytes, ctx: SessionContext | None = None) -> Expr:

0 commit comments

Comments
 (0)