(stream_fixture)
| 590 | |
| 591 | |
| 592 | def test_read_options_included_fields(stream_fixture): |
| 593 | options1 = pa.ipc.IpcReadOptions() |
| 594 | options2 = pa.ipc.IpcReadOptions(included_fields=[1]) |
| 595 | table = pa.Table.from_arrays([pa.array(['foo', 'bar', 'baz', 'qux']), |
| 596 | pa.array([1, 2, 3, 4])], |
| 597 | names=['a', 'b']) |
| 598 | with stream_fixture._get_writer(stream_fixture.sink, table.schema) as wr: |
| 599 | wr.write_table(table) |
| 600 | source = stream_fixture.get_source() |
| 601 | |
| 602 | reader1 = pa.ipc.open_stream(source, options=options1) |
| 603 | reader2 = pa.ipc.open_stream( |
| 604 | source, options=options2, memory_pool=pa.system_memory_pool()) |
| 605 | |
| 606 | result1 = reader1.read_all() |
| 607 | result2 = reader2.read_all() |
| 608 | |
| 609 | assert result1.num_columns == 2 |
| 610 | assert result2.num_columns == 1 |
| 611 | |
| 612 | expected = pa.Table.from_arrays([pa.array([1, 2, 3, 4])], names=["b"]) |
| 613 | assert result2 == expected |
| 614 | assert result1 == table |
| 615 | |
| 616 | |
| 617 | def test_dictionary_delta(format_fixture): |
nothing calls this directly
no test coverage detected