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

Function record_batches

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

Source from the content-addressed store, hash-verified

417
418@st.composite
419def record_batches(draw, type, rows=None, max_fields=None):
420 if isinstance(rows, st.SearchStrategy):
421 rows = draw(rows)
422 elif rows is None:
423 rows = draw(_default_array_sizes)
424 elif not isinstance(rows, int):
425 raise TypeError('Rows must be an integer')
426
427 schema = draw(schemas(type, max_fields=max_fields))
428 children = [draw(arrays(field.type, size=rows)) for field in schema]
429 return pa.RecordBatch.from_arrays(children, schema=schema)
430
431
432@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