()
| 682 | |
| 683 | |
| 684 | def test_empty_table(): |
| 685 | schema1 = pa.schema([ |
| 686 | pa.field('f0', pa.int64()), |
| 687 | pa.field('f1', pa.dictionary(pa.int32(), pa.string())), |
| 688 | pa.field('f2', pa.list_(pa.list_(pa.int64()))), |
| 689 | ]) |
| 690 | # test it preserves field nullability |
| 691 | schema2 = pa.schema([ |
| 692 | pa.field('a', pa.int64(), nullable=False), |
| 693 | pa.field('b', pa.int64()) |
| 694 | ]) |
| 695 | |
| 696 | for schema in [schema1, schema2]: |
| 697 | table = schema.empty_table() |
| 698 | assert isinstance(table, pa.Table) |
| 699 | assert table.num_rows == 0 |
| 700 | assert table.schema == schema |
| 701 | |
| 702 | |
| 703 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected