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

Function record_batches

python/pyarrow/tests/strategies.py:439–449  ·  view source on GitHub ↗
(draw, type, rows=None, max_fields=None)

Source from the content-addressed store, hash-verified

437
438@st.composite
439def record_batches(draw, type, rows=None, max_fields=None):
440 if isinstance(rows, st.SearchStrategy):
441 rows = draw(rows)
442 elif rows is None:
443 rows = draw(_default_array_sizes)
444 elif not isinstance(rows, int):
445 raise TypeError('Rows must be an integer')
446
447 schema = draw(schemas(type, max_fields=max_fields))
448 children = [draw(arrays(field.type, size=rows)) for field in schema]
449 return pa.RecordBatch.from_arrays(children, schema=schema)
450
451
452@st.composite

Callers 1

strategies.pyFile · 0.85

Calls 3

schemasFunction · 0.85
arraysFunction · 0.85
TypeErrorFunction · 0.50

Tested by

no test coverage detected