MCPcopy Create free account
hub / github.com/apache/arrow / test_read_options_included_fields

Function test_read_options_included_fields

python/pyarrow/tests/test_ipc.py:568–590  ·  view source on GitHub ↗
(stream_fixture)

Source from the content-addressed store, hash-verified

566
567
568def 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
593def test_dictionary_delta(format_fixture):

Callers

nothing calls this directly

Calls 5

get_sourceMethod · 0.80
system_memory_poolMethod · 0.80
arrayMethod · 0.45
_get_writerMethod · 0.45
write_tableMethod · 0.45

Tested by

no test coverage detected