| 431 | |
| 432 | @st.composite |
| 433 | def tables(draw, type, rows=None, max_fields=None): |
| 434 | if isinstance(rows, st.SearchStrategy): |
| 435 | rows = draw(rows) |
| 436 | elif rows is None: |
| 437 | rows = draw(_default_array_sizes) |
| 438 | elif not isinstance(rows, int): |
| 439 | raise TypeError('Rows must be an integer') |
| 440 | |
| 441 | schema = draw(schemas(type, max_fields=max_fields)) |
| 442 | children = [draw(arrays(field.type, size=rows)) for field in schema] |
| 443 | return pa.Table.from_arrays(children, schema=schema) |
| 444 | |
| 445 | |
| 446 | all_arrays = arrays(all_types) |