(stream_fixture)
| 566 | |
| 567 | |
| 568 | def test_read_options_included_fields(stream_fixture): |
| 569 | options1 = pa.ipc.IpcReadOptions() |
| 570 | options2 = pa.ipc.IpcReadOptions(included_fields=[1]) |
| 571 | table = pa.Table.from_arrays([pa.array(['foo', 'bar', 'baz', 'qux']), |
| 572 | pa.array([1, 2, 3, 4])], |
| 573 | names=['a', 'b']) |
| 574 | with stream_fixture._get_writer(stream_fixture.sink, table.schema) as wr: |
| 575 | wr.write_table(table) |
| 576 | source = stream_fixture.get_source() |
| 577 | |
| 578 | reader1 = pa.ipc.open_stream(source, options=options1) |
| 579 | reader2 = pa.ipc.open_stream( |
| 580 | source, options=options2, memory_pool=pa.system_memory_pool()) |
| 581 | |
| 582 | result1 = reader1.read_all() |
| 583 | result2 = reader2.read_all() |
| 584 | |
| 585 | assert result1.num_columns == 2 |
| 586 | assert result2.num_columns == 1 |
| 587 | |
| 588 | expected = pa.Table.from_arrays([pa.array([1, 2, 3, 4])], names=["b"]) |
| 589 | assert result2 == expected |
| 590 | assert result1 == table |
| 591 | |
| 592 | |
| 593 | def test_dictionary_delta(format_fixture): |
nothing calls this directly
no test coverage detected