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

Function _check_output

tests/test_arrow_writer.py:80–86  ·  view source on GitHub ↗
(output, expected_num_chunks: int)

Source from the content-addressed store, hash-verified

78
79
80def _check_output(output, expected_num_chunks: int):
81 stream = pa.BufferReader(output) if isinstance(output, pa.Buffer) else pa.memory_map(output)
82 f = pa.ipc.open_stream(stream)
83 pa_table: pa.Table = f.read_all()
84 assert len(pa_table.to_batches()) == expected_num_chunks
85 assert pa_table.to_pydict() == {"col_1": ["foo", "bar"], "col_2": [1, 2]}
86 del pa_table
87
88
89@pytest.mark.parametrize("writer_batch_size", [None, 1, 10])

Callers 6

test_writeFunction · 0.85
test_write_with_keysFunction · 0.85
test_write_batchFunction · 0.85
test_write_tableFunction · 0.85
test_write_rowFunction · 0.85
test_write_fileFunction · 0.85

Calls 2

to_batchesMethod · 0.80
to_pydictMethod · 0.80

Tested by

no test coverage detected