MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_table_roundtrip

Function test_table_roundtrip

arrow-pyarrow-integration-testing/tests/test_sql.py:673–688  ·  view source on GitHub ↗

Python -> Rust -> Python

()

Source from the content-addressed store, hash-verified

671
672
673def test_table_roundtrip():
674 """
675 Python -> Rust -> Python
676 """
677 schema = pa.schema([pa.field(name='ints', type=pa.list_(pa.int32()), metadata={b'key1': b'value1'})], metadata={b'key1': b'value1'})
678 batches = [
679 pa.record_batch([[[1], [2, 42]]], schema),
680 pa.record_batch([[None, [], [5, 6]]], schema),
681 ]
682 table = pa.Table.from_batches(batches, schema=schema)
683 new_table = rust.round_trip_table(table)
684
685 assert table == new_table
686 assert table.schema == new_table.schema
687 assert table.schema.metadata == new_table.schema.metadata
688 assert len(table.to_batches()) == len(new_table.to_batches())
689
690
691def test_table_from_batches():

Callers

nothing calls this directly

Calls 3

schemaMethod · 0.45
fieldMethod · 0.45
record_batchMethod · 0.45

Tested by

no test coverage detected