Skip to content

Commit 9169146

Browse files
timsaucerclaude
andcommitted
Fix deregister tests to expect ValueError instead of RuntimeError
DataFusion raises ValueError for planning errors when a deregistered function is used in a query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 03fde8a commit 9169146

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/tests/test_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def test_deregister_udf():
372372

373373
# Deregister and verify it's gone
374374
ctx.deregister_udf("my_is_null")
375-
with pytest.raises(RuntimeError):
375+
with pytest.raises(ValueError):
376376
ctx.sql("SELECT my_is_null(a) FROM t").collect()
377377

378378

@@ -414,7 +414,7 @@ def evaluate(self) -> pa.Scalar:
414414
assert result[0].column(0) == pa.array([6.0])
415415

416416
ctx.deregister_udaf("my_sum")
417-
with pytest.raises(RuntimeError):
417+
with pytest.raises(ValueError):
418418
ctx.sql("SELECT my_sum(a) FROM t").collect()
419419

420420

@@ -445,7 +445,7 @@ def evaluate_all(self, values, num_rows):
445445
assert result[0].column(0) == pa.array([1, 2, 3], type=pa.uint64())
446446

447447
ctx.deregister_udwf("my_row_number")
448-
with pytest.raises(RuntimeError):
448+
with pytest.raises(ValueError):
449449
ctx.sql("SELECT my_row_number(a) OVER () FROM t").collect()
450450

451451

@@ -467,7 +467,7 @@ def __call__(self):
467467
assert result[0].column(0) == pa.array([1, 2, 3])
468468

469469
ctx.deregister_udtf("my_table")
470-
with pytest.raises(RuntimeError):
470+
with pytest.raises(ValueError):
471471
ctx.sql("SELECT * FROM my_table()").collect()
472472

473473

0 commit comments

Comments
 (0)