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

Function test_dataset

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

Source from the content-addressed store, hash-verified

140
141@pytest.mark.numpy
142def test_dataset(version):
143 num_values = (100, 100)
144 num_files = 5
145 paths = [random_path() for i in range(num_files)]
146 data = {
147 "col_" + str(i): np.random.randn(num_values[0])
148 for i in range(num_values[1])
149 }
150 table = pa.table(data)
151
152 TEST_FILES.extend(paths)
153 for index, path in enumerate(paths):
154 rows = (
155 index * (num_values[0] // num_files),
156 (index + 1) * (num_values[0] // num_files),
157 )
158
159 write_feather(table[rows[0]: rows[1]], path, version=version)
160
161 data = FeatherDataset(paths).read_table()
162 assert data.equals(table)
163
164
165@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