(tempdir)
| 187 | |
| 188 | |
| 189 | def test_read_table_without_dataset(tempdir): |
| 190 | from unittest import mock |
| 191 | |
| 192 | class MockParquetDataset: |
| 193 | def __init__(self, *args, **kwargs): |
| 194 | raise ImportError("MockParquetDataset") |
| 195 | |
| 196 | path = tempdir / "test.parquet" |
| 197 | table = pa.table({"a": [1, 2, 3]}) |
| 198 | _write_table(table, path) |
| 199 | |
| 200 | with mock.patch('pyarrow.parquet.core.ParquetDataset', new=MockParquetDataset): |
| 201 | with pytest.raises(ValueError, match="the 'filters' keyword"): |
| 202 | pq.read_table(path, filters=[('integer', '=', 1)]) |
| 203 | with pytest.raises(ValueError, match="the 'partitioning' keyword"): |
| 204 | pq.read_table(path, partitioning=['week', 'color']) |
| 205 | with pytest.raises(ValueError, match="the 'schema' argument"): |
| 206 | pq.read_table(path, schema=table.schema) |
| 207 | with pytest.raises(ValueError, match="the 'source' argument"): |
| 208 | pq.read_table(tempdir) |
| 209 | result = pq.read_table(path) |
| 210 | assert result == table |
| 211 | |
| 212 | |
| 213 | @pytest.mark.slow |
nothing calls this directly
no test coverage detected