Skip to content

Commit d578c85

Browse files
timsaucerclaude
andcommitted
refactor(tests): drop redundant inline Expr reimports
Four test methods re-imported `Expr` from `datafusion` despite the module top already importing it on line 35. Removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8a22df1 commit d578c85

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

python/tests/test_pickle_expr.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ def test_agg_udf_decodes_into_fresh_ctx(self):
182182
e = u(col("a"))
183183
blob = e.to_bytes()
184184
fresh = SessionContext()
185-
from datafusion import Expr
186-
187185
decoded = Expr.from_bytes(blob, ctx=fresh)
188186
assert "count_all" in decoded.canonical_name()
189187

@@ -237,8 +235,6 @@ def test_window_udf_decodes_into_fresh_ctx(self):
237235
e = u(col("a"))
238236
blob = e.to_bytes()
239237
fresh = SessionContext()
240-
from datafusion import Expr
241-
242238
decoded = Expr.from_bytes(blob, ctx=fresh)
243239
assert "count_up" in decoded.canonical_name()
244240

@@ -280,8 +276,6 @@ def test_strict_roundtrip_via_registry(self):
280276
"""When both sender and receiver disable inlining, the UDF
281277
travels by name only and the receiver resolves it from its
282278
registered functions."""
283-
from datafusion import Expr
284-
285279
strict_sender = SessionContext().with_python_udf_inlining(False)
286280
u = self._build_double_udf()
287281
blob = u(col("a")).to_bytes(strict_sender)
@@ -294,8 +288,6 @@ def test_strict_roundtrip_via_registry(self):
294288
def test_strict_decoder_refuses_inline_payload(self):
295289
"""An inline-encoded blob fed to a strict receiver raises with a
296290
clear error rather than silently invoking cloudpickle.loads."""
297-
from datafusion import Expr
298-
299291
sender = SessionContext()
300292
u = self._build_double_udf()
301293
blob = u(col("a")).to_bytes(sender)

0 commit comments

Comments
 (0)