MCPcopy
hub / github.com/huggingface/datasets / arrow_file_streaming_format

Function arrow_file_streaming_format

tests/packaged_modules/test_arrow.py:10–20  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

8
9@pytest.fixture
10def arrow_file_streaming_format(tmp_path):
11 filename = tmp_path / "stream.arrow"
12 testdata = [[1, 1, 1], [0, 100, 6], [1, 90, 900]]
13
14 schema = pa.schema([pa.field("input_ids", pa.list_(pa.int32()))])
15 array = pa.array(testdata, type=pa.list_(pa.int32()))
16 table = pa.Table.from_arrays([array], schema=schema)
17 with open(filename, "wb") as f:
18 with pa.ipc.new_stream(f, schema) as writer:
19 writer.write_table(table)
20 return str(filename)
21
22
23@pytest.fixture

Callers

nothing calls this directly

Calls 4

fieldMethod · 0.80
from_arraysMethod · 0.80
write_tableMethod · 0.80
schemaMethod · 0.45

Tested by

no test coverage detected