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

Function test_read_options

python/pyarrow/tests/test_ipc.py:558–589  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

556
557
558def test_read_options():
559 options = pa.ipc.IpcReadOptions()
560 assert options.use_threads is True
561 assert options.ensure_native_endian is True
562 assert options.ensure_alignment == pa.ipc.Alignment.Any
563 assert options.included_fields == []
564
565 options.ensure_native_endian = False
566 assert options.ensure_native_endian is False
567
568 options.ensure_alignment = pa.ipc.Alignment.DataTypeSpecific
569 assert options.ensure_alignment == pa.ipc.Alignment.DataTypeSpecific
570 options.ensure_alignment = pa.ipc.Alignment.At64Byte
571 assert options.ensure_alignment == pa.ipc.Alignment.At64Byte
572
573 options.use_threads = False
574 assert options.use_threads is False
575
576 options.included_fields = [0, 1]
577 assert options.included_fields == [0, 1]
578
579 with pytest.raises(TypeError):
580 options.included_fields = None
581
582 options = pa.ipc.IpcReadOptions(
583 use_threads=False, ensure_native_endian=False,
584 ensure_alignment=pa.ipc.Alignment.DataTypeSpecific, included_fields=[1]
585 )
586 assert options.use_threads is False
587 assert options.ensure_native_endian is False
588 assert options.ensure_alignment == pa.ipc.Alignment.DataTypeSpecific
589 assert options.included_fields == [1]
590
591
592def test_read_options_included_fields(stream_fixture):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected