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

Function make_sample_file

python/pyarrow/tests/parquet/common.py:132–144  ·  view source on GitHub ↗
(table_or_df)

Source from the content-addressed store, hash-verified

130
131
132def make_sample_file(table_or_df):
133 import pyarrow.parquet as pq
134
135 if isinstance(table_or_df, pa.Table):
136 a_table = table_or_df
137 else:
138 a_table = pa.Table.from_pandas(table_or_df)
139
140 buf = io.BytesIO()
141 _write_table(a_table, buf, compression='SNAPPY', version='2.6')
142
143 buf.seek(0)
144 return pq.ParquetFile(buf)
145
146
147def alltypes_sample(size=10000, seed=0, categorical=False):

Calls 2

_write_tableFunction · 0.85
seekMethod · 0.80