(tempdir, dataset_reader)
| 3434 | |
| 3435 | @pytest.mark.orc |
| 3436 | def test_orc_scan_options(tempdir, dataset_reader): |
| 3437 | from pyarrow import orc |
| 3438 | table = pa.table({'a': pa.array([1, 2, 3], type="int8"), |
| 3439 | 'b': pa.array([.1, .2, .3], type="float64")}) |
| 3440 | |
| 3441 | path = str(tempdir / 'test.orc') |
| 3442 | orc.write_table(table, path) |
| 3443 | |
| 3444 | dataset = ds.dataset(path, format="orc") |
| 3445 | result = list(dataset_reader.to_batches(dataset)) |
| 3446 | assert len(result) == 1 |
| 3447 | assert result[0].num_rows == 3 |
| 3448 | assert result[0].equals(table.to_batches()[0]) |
| 3449 | |
| 3450 | result = list(dataset_reader.to_batches(dataset, batch_size=2)) |
| 3451 | assert len(result) == 2 |
| 3452 | assert result[0].num_rows == 2 |
| 3453 | assert result[0].equals(table.slice(0, 2).to_batches()[0]) |
| 3454 | assert result[1].num_rows == 1 |
| 3455 | assert result[1].equals(table.slice(2, 1).to_batches()[0]) |
| 3456 | |
| 3457 | |
| 3458 | def test_orc_format_not_supported(): |
nothing calls this directly
no test coverage detected