westonpace commented on code in PR #40696:
URL: https://github.com/apache/arrow/pull/40696#discussion_r1535665104
##########
python/pyarrow/tests/test_substrait.py:
##########
@@ -944,6 +944,31 @@ def test_serializing_expressions(expr):
assert "test_expr" in returned.expressions
+def test_arrow_specific_types():
+ schema = pa.schema(
+ [
+ pa.field("time_nanos", pa.time64("ns")),
+ pa.field("date_millis", pa.date64()),
+ pa.field("large_string", pa.large_string()),
+ pa.field("large_binary", pa.large_binary()),
+ ]
+ )
+
+ def check_round_trip(expr):
+ buf = pa.substrait.serialize_expressions([expr], ["test_expr"], schema)
+ returned = pa.substrait.deserialize_expressions(buf)
+ assert schema == returned.schema
+
+ check_round_trip(pc.field("large_string") == "test_string")
+ check_round_trip(pc.field("large_binary") == "test_string")
+ # Arrow-cpp supports round tripping these types but pyarrow doesn't support
+ # constructing literals of these types
+ #
+ # So best we can do is verify field references work
+ check_round_trip(pc.field("time_nanos"))
Review Comment:
Thanks for the suggestion, it worked well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]