From 9950dc5eb48f0bdc495563a50f81e668f265b49f Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Wed, 10 Dec 2025 07:02:30 +0900 Subject: [PATCH] Fix test_parquet_file_too_small to catch only ArrowInvalid --- python/pyarrow/tests/parquet/test_basic.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/pyarrow/tests/parquet/test_basic.py b/python/pyarrow/tests/parquet/test_basic.py index 3b991fdd57a..94868741f39 100644 --- a/python/pyarrow/tests/parquet/test_basic.py +++ b/python/pyarrow/tests/parquet/test_basic.py @@ -713,15 +713,12 @@ def test_zlib_compression_bug(): def test_parquet_file_too_small(tempdir): path = str(tempdir / "test.parquet") - # TODO(dataset) with datasets API it raises OSError instead - with pytest.raises((pa.ArrowInvalid, OSError), - match='size is 0 bytes'): + with pytest.raises(pa.ArrowInvalid, match='size is 0 bytes'): with open(path, 'wb') as f: pass pq.read_table(path) - with pytest.raises((pa.ArrowInvalid, OSError), - match='size is 4 bytes'): + with pytest.raises(pa.ArrowInvalid, match='size is 4 bytes'): with open(path, 'wb') as f: f.write(b'ffff') pq.read_table(path)