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

Function test_empty_table

python/pyarrow/tests/test_schema.py:684–700  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

682
683
684def 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

Callers

nothing calls this directly

Calls 4

schemaMethod · 0.45
fieldMethod · 0.45
dictionaryMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected