()
| 476 | |
| 477 | |
| 478 | def test_write_options(): |
| 479 | options = pa.ipc.IpcWriteOptions() |
| 480 | assert options.allow_64bit is False |
| 481 | assert options.use_legacy_format is False |
| 482 | assert options.metadata_version == pa.ipc.MetadataVersion.V5 |
| 483 | |
| 484 | options.allow_64bit = True |
| 485 | assert options.allow_64bit is True |
| 486 | |
| 487 | options.use_legacy_format = True |
| 488 | assert options.use_legacy_format is True |
| 489 | |
| 490 | options.metadata_version = pa.ipc.MetadataVersion.V4 |
| 491 | assert options.metadata_version == pa.ipc.MetadataVersion.V4 |
| 492 | for value in ('V5', 42): |
| 493 | with pytest.raises((TypeError, ValueError)): |
| 494 | options.metadata_version = value |
| 495 | |
| 496 | assert options.compression is None |
| 497 | for value in ['lz4', 'zstd']: |
| 498 | if pa.Codec.is_available(value): |
| 499 | options.compression = value |
| 500 | assert options.compression == value |
| 501 | options.compression = value.upper() |
| 502 | assert options.compression == value |
| 503 | options.compression = None |
| 504 | assert options.compression is None |
| 505 | |
| 506 | with pytest.raises(TypeError): |
| 507 | options.compression = 0 |
| 508 | |
| 509 | assert options.use_threads is True |
| 510 | options.use_threads = False |
| 511 | assert options.use_threads is False |
| 512 | |
| 513 | if pa.Codec.is_available('lz4'): |
| 514 | options = pa.ipc.IpcWriteOptions( |
| 515 | metadata_version=pa.ipc.MetadataVersion.V4, |
| 516 | allow_64bit=True, |
| 517 | use_legacy_format=True, |
| 518 | compression='lz4', |
| 519 | use_threads=False) |
| 520 | assert options.metadata_version == pa.ipc.MetadataVersion.V4 |
| 521 | assert options.allow_64bit is True |
| 522 | assert options.use_legacy_format is True |
| 523 | assert options.compression == 'lz4' |
| 524 | assert options.use_threads is False |
| 525 | |
| 526 | |
| 527 | @pytest.mark.parametrize('options', [ |
nothing calls this directly
no outgoing calls
no test coverage detected