| 128 | |
| 129 | |
| 130 | def _get_legacy_format_default(options): |
| 131 | if options: |
| 132 | if not isinstance(options, IpcWriteOptions): |
| 133 | raise TypeError(f"expected IpcWriteOptions, got {type(options)}") |
| 134 | return options |
| 135 | |
| 136 | metadata_version = MetadataVersion.V5 |
| 137 | use_legacy_format = \ |
| 138 | bool(int(os.environ.get('ARROW_PRE_0_15_IPC_FORMAT', '0'))) |
| 139 | if bool(int(os.environ.get('ARROW_PRE_1_0_METADATA_VERSION', '0'))): |
| 140 | metadata_version = MetadataVersion.V4 |
| 141 | return IpcWriteOptions(use_legacy_format=use_legacy_format, |
| 142 | metadata_version=metadata_version) |
| 143 | |
| 144 | |
| 145 | def _ensure_default_ipc_read_options(options): |