Skip to content

Commit b9c6045

Browse files
timsaucerclaude
andcommitted
test(pickle): drop dead register_udf in strict refusal test
`test_strict_decoder_refuses_inline_payload` registered the UDF on the strict receiver, but the codec refusal trips before the receiver's function registry is ever consulted — the registration was never exercised. Worse: keeping it there would mask a real regression that moved the strict-mode check downstream of registry lookup, because the registry hit would resolve the UDF instead of letting the refusal surface. Drop the register_udf call and call out in the docstring why the absence is load-bearing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dfcf3bc commit b9c6045

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

python/tests/test_pickle_expr.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,18 @@ def test_strict_roundtrip_via_registry(self):
287287

288288
def test_strict_decoder_refuses_inline_payload(self):
289289
"""An inline-encoded blob fed to a strict receiver raises with a
290-
clear error rather than silently invoking cloudpickle.loads."""
290+
clear error rather than silently invoking cloudpickle.loads.
291+
292+
The receiver is intentionally *not* given a matching
293+
registration: the codec refusal must trip before the registry
294+
is ever consulted, so registering the UDF here would only mask
295+
a regression that moved the check after registry lookup.
296+
"""
291297
sender = SessionContext()
292298
u = self._build_double_udf()
293299
blob = u(col("a")).to_bytes(sender)
294300

295301
strict_receiver = SessionContext().with_python_udf_inlining(enabled=False)
296-
strict_receiver.register_udf(u)
297302
# `RuntimeError` (not bare `Exception`): the codec refusal is
298303
# surfaced through `parse_expr` → `PyRuntimeError`. Tightening
299304
# the assertion catches a regression that swallows the refusal

0 commit comments

Comments
 (0)