diff --git a/tests/test_sharded_dataset.py b/tests/test_sharded_dataset.py index 265a70867..90ab6c34b 100644 --- a/tests/test_sharded_dataset.py +++ b/tests/test_sharded_dataset.py @@ -48,14 +48,12 @@ def test_basic_parquet_datasource_read_row(): import pyarrow as pa import pyarrow.parquet as pq - with tempfile.NamedTemporaryFile(suffix=".parquet", delete=False) as f: + with tempfile.NamedTemporaryFile(suffix=".parquet", delete=True) as f: # Create a simple dataset data = {"column1": ["value1", "value2", "value3"], "column2": [10, 20, 30]} table = pa.Table.from_pydict(data) pq.write_table(table, f.name) - try: - datasource = ParquetDataSource([os.path.abspath(f.name)]) assert len(datasource.shard_names) == 1, "Expected only one shard" @@ -70,6 +68,3 @@ def test_basic_parquet_datasource_read_row(): assert row_data[0]["column2"] == 20 assert row_data[1]["column1"] == "value3" assert row_data[1]["column2"] == 30 - - finally: - os.unlink(f.name)