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

Function test_serializing_schema

python/pyarrow/tests/test_substrait.py:1095–1114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1093
1094
1095def test_serializing_schema():
1096 substrait_schema = b'\n\x01x\n\x01y\x12\x0c\n\x04*\x02\x10\x01\n\x04b\x02\x10\x01'
1097 expected_schema = pa.schema([
1098 pa.field("x", pa.int32()),
1099 pa.field("y", pa.string())
1100 ])
1101 returned = pa.substrait.deserialize_schema(substrait_schema)
1102 assert expected_schema == returned
1103
1104 arrow_substrait_schema = pa.substrait.serialize_schema(returned)
1105 assert arrow_substrait_schema.schema == substrait_schema
1106
1107 returned = pa.substrait.deserialize_schema(arrow_substrait_schema)
1108 assert expected_schema == returned
1109
1110 returned = pa.substrait.deserialize_schema(arrow_substrait_schema.schema)
1111 assert expected_schema == returned
1112
1113 returned = pa.substrait.deserialize_expressions(arrow_substrait_schema.expression)
1114 assert returned.schema == expected_schema
1115
1116
1117def test_bound_expression_from_Message():

Callers

nothing calls this directly

Calls 3

schemaMethod · 0.45
fieldMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected