| 451 | |
| 452 | @st.composite |
| 453 | def tables(draw, type, rows=None, max_fields=None): |
| 454 | if isinstance(rows, st.SearchStrategy): |
| 455 | rows = draw(rows) |
| 456 | elif rows is None: |
| 457 | rows = draw(_default_array_sizes) |
| 458 | elif not isinstance(rows, int): |
| 459 | raise TypeError('Rows must be an integer') |
| 460 | |
| 461 | schema = draw(schemas(type, max_fields=max_fields)) |
| 462 | children = [draw(arrays(field.type, size=rows)) for field in schema] |
| 463 | return pa.Table.from_arrays(children, schema=schema) |
| 464 | |
| 465 | |
| 466 | all_arrays = arrays(all_types) |