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

Function _check_roundtrip

python/pyarrow/tests/parquet/common.py:60–75  ·  view source on GitHub ↗
(table, expected=None, read_table_kwargs=None,
                     **write_table_kwargs)

Source from the content-addressed store, hash-verified

58
59
60def _check_roundtrip(table, expected=None, read_table_kwargs=None,
61 **write_table_kwargs):
62 if expected is None:
63 expected = table
64
65 read_table_kwargs = read_table_kwargs or {}
66
67 # intentionally check twice
68 result = _roundtrip_table(table, read_table_kwargs=read_table_kwargs,
69 write_table_kwargs=write_table_kwargs)
70 assert result.schema == expected.schema
71 assert result.equals(expected)
72 result = _roundtrip_table(result, read_table_kwargs=read_table_kwargs,
73 write_table_kwargs=write_table_kwargs)
74 assert result.schema == expected.schema
75 assert result.equals(expected)
76
77
78def _roundtrip_pandas_dataframe(df, write_kwargs):

Calls 2

_roundtrip_tableFunction · 0.85
equalsMethod · 0.80