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

Method test_stress_block_sizes

python/pyarrow/tests/test_json.py:314–330  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

312
313 @pytest.mark.numpy
314 def test_stress_block_sizes(self):
315 # Test a number of small block sizes to stress block stitching
316 data_base, expected = make_random_json(num_cols=2, num_rows=100)
317 read_options = ReadOptions()
318 parse_options = ParseOptions()
319
320 for data in [data_base, data_base.rstrip(b'\r\n')]:
321 for newlines_in_values in [False, True]:
322 parse_options.newlines_in_values = newlines_in_values
323 for block_size in [22, 23, 37]:
324 read_options.block_size = block_size
325 table = self.read_bytes(data, read_options=read_options,
326 parse_options=parse_options)
327 assert table.schema == expected.schema
328 if not table.equals(expected):
329 # Better error output
330 assert table.to_pydict() == expected.to_pydict()
331
332
333class BaseTestJSONRead(BaseTestJSON):

Callers

nothing calls this directly

Calls 5

read_bytesMethod · 0.95
ReadOptionsClass · 0.90
ParseOptionsClass · 0.90
make_random_jsonFunction · 0.85
equalsMethod · 0.80

Tested by

no test coverage detected