(pickle_module)
| 1066 | |
| 1067 | |
| 1068 | def test_file_format_pickling(pickle_module): |
| 1069 | formats = [ |
| 1070 | ds.IpcFileFormat(), |
| 1071 | ds.CsvFileFormat(), |
| 1072 | ds.CsvFileFormat(pa.csv.ParseOptions(delimiter='\t', |
| 1073 | ignore_empty_lines=True)), |
| 1074 | ds.CsvFileFormat(read_options=pa.csv.ReadOptions( |
| 1075 | skip_rows=3, column_names=['foo'])), |
| 1076 | ds.CsvFileFormat(read_options=pa.csv.ReadOptions( |
| 1077 | skip_rows=3, block_size=2**20)), |
| 1078 | ds.JsonFileFormat(), |
| 1079 | ds.JsonFileFormat( |
| 1080 | parse_options=pa.json.ParseOptions(newlines_in_values=True, |
| 1081 | unexpected_field_behavior="ignore")), |
| 1082 | ds.JsonFileFormat(read_options=pa.json.ReadOptions( |
| 1083 | use_threads=False, block_size=14)), |
| 1084 | ] |
| 1085 | try: |
| 1086 | formats.append(ds.OrcFileFormat()) |
| 1087 | except ImportError: |
| 1088 | pass |
| 1089 | |
| 1090 | if pq is not None: |
| 1091 | formats.extend([ |
| 1092 | ds.ParquetFileFormat(), |
| 1093 | ds.ParquetFileFormat(dictionary_columns={'a'}), |
| 1094 | ds.ParquetFileFormat(use_buffered_stream=True), |
| 1095 | ds.ParquetFileFormat( |
| 1096 | use_buffered_stream=True, |
| 1097 | buffer_size=4096, |
| 1098 | thrift_string_size_limit=123, |
| 1099 | thrift_container_size_limit=456, |
| 1100 | ), |
| 1101 | ]) |
| 1102 | |
| 1103 | for file_format in formats: |
| 1104 | assert pickle_module.loads(pickle_module.dumps(file_format)) == file_format |
| 1105 | |
| 1106 | |
| 1107 | def test_fragment_scan_options_pickling(pickle_module): |
nothing calls this directly
no test coverage detected