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

Function test_dataset

python/pyarrow/tests/test_feather.py:149–169  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

147
148@pytest.mark.numpy
149def test_dataset(version):
150 num_values = (100, 100)
151 num_files = 5
152 paths = [random_path() for i in range(num_files)]
153 data = {
154 "col_" + str(i): np.random.randn(num_values[0])
155 for i in range(num_values[1])
156 }
157 table = pa.table(data)
158
159 TEST_FILES.extend(paths)
160 for index, path in enumerate(paths):
161 rows = (
162 index * (num_values[0] // num_files),
163 (index + 1) * (num_values[0] // num_files),
164 )
165
166 write_feather(table[rows[0]: rows[1]], path, version=version)
167
168 data = FeatherDataset(paths).read_table()
169 assert data.equals(table)
170
171
172@pytest.mark.pandas

Callers

nothing calls this directly

Calls 6

write_featherFunction · 0.90
FeatherDatasetClass · 0.90
random_pathFunction · 0.85
extendMethod · 0.80
equalsMethod · 0.80
read_tableMethod · 0.45

Tested by

no test coverage detected