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

Method test_stress_block_sizes

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

Source from the content-addressed store, hash-verified

322
323 @pytest.mark.numpy
324 def test_stress_block_sizes(self):
325 # Test a number of small block sizes to stress block stitching
326 for extra_whitespace in (False, True):
327 data_base, max_line_len, expected = make_random_json(
328 num_cols=2, num_rows=100,
329 extra_whitespace=extra_whitespace)
330 block_sizes = [max_line_len, max_line_len + 4, max_line_len + 15]
331
332 read_options = ReadOptions()
333 parse_options = ParseOptions()
334
335 for data in [data_base, data_base.rstrip(b'\r\n')]:
336 for newlines_in_values in [False, True]:
337 parse_options.newlines_in_values = newlines_in_values
338 for block_size in block_sizes:
339 read_options.block_size = block_size
340 table = self.read_bytes(data, read_options=read_options,
341 parse_options=parse_options)
342 assert table.schema == expected.schema
343 if not table.equals(expected):
344 # Better error output
345 assert table.to_pydict() == expected.to_pydict()
346
347
348class 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