| 934 | pc.field("x") > 50 |
| 935 | ]) |
| 936 | def test_serializing_expressions(expr): |
| 937 | schema = pa.schema([ |
| 938 | pa.field("x", pa.int32()), |
| 939 | pa.field("y", pa.int32()) |
| 940 | ]) |
| 941 | |
| 942 | buf = pa.substrait.serialize_expressions([expr], ["test_expr"], schema) |
| 943 | returned = pa.substrait.deserialize_expressions(buf) |
| 944 | assert schema == returned.schema |
| 945 | assert len(returned.expressions) == 1 |
| 946 | assert "test_expr" in returned.expressions |
| 947 | |
| 948 | |
| 949 | @pytest.mark.parametrize("func", [pc.starts_with, pc.ends_with, pc.match_substring]) |