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

Function _check_pandas_roundtrip

python/pyarrow/tests/test_feather.py:95–117  ·  view source on GitHub ↗
(df, expected=None, path=None,
                            columns=None, use_threads=False,
                            version=None, compression=None,
                            compression_level=None)

Source from the content-addressed store, hash-verified

93
94
95def _check_pandas_roundtrip(df, expected=None, path=None,
96 columns=None, use_threads=False,
97 version=None, compression=None,
98 compression_level=None):
99 if path is None:
100 path = random_path()
101
102 if version is None:
103 version = 2
104
105 TEST_FILES.append(path)
106 write_feather(df, path, compression=compression,
107 compression_level=compression_level, version=version)
108
109 if not os.path.exists(path):
110 raise Exception('file not written')
111
112 result = read_feather(path, columns, use_threads=use_threads)
113
114 if expected is None:
115 expected = df
116
117 assert_frame_equal(result, expected)
118
119
120def _check_arrow_roundtrip(table, path=None, compression=None):

Callers 15

test_float_no_nullsFunction · 0.70
test_float_nullsFunction · 0.70
test_integer_no_nullsFunction · 0.70
test_integer_with_nullsFunction · 0.70
test_boolean_no_nullsFunction · 0.70
test_boolean_nullsFunction · 0.70
test_stringsFunction · 0.70
test_empty_stringsFunction · 0.70
test_all_noneFunction · 0.70
test_all_null_categoryFunction · 0.70
test_multithreaded_readFunction · 0.70

Calls 4

write_featherFunction · 0.90
read_featherFunction · 0.90
random_pathFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected