vibhatha commented on code in PR #12672:
URL: https://github.com/apache/arrow/pull/12672#discussion_r874306927


##########
python/pyarrow/tests/test_substrait.py:
##########
@@ -0,0 +1,93 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import os
+import sys
+import pytest
+
+import pyarrow as pa
+from pyarrow.lib import tobytes
+from pyarrow.lib import ArrowInvalid
+
+try:
+    import pyarrow.substrait as substrait
+except ImportError:
+    substrait = None
+
+# Marks all of the tests in this module
+# Ignore these with pytest ... -m 'not substrait'
+pytestmark = [pytest.mark.dataset, pytest.mark.substrait]
+
+
[email protected](sys.platform == 'win32',
+                    reason="ARROW-16392: file based URI is" +
+                    " not fully supported for Windows")
+def test_run_serialized_query(tmpdir):
+    substrait_query = """
+    {
+        "relations": [
+        {"rel": {
+            "read": {
+            "base_schema": {
+                "struct": {
+                "types": [
+                            {"i64": {}}
+                        ]
+                },
+                "names": [
+                        "foo"
+                        ]
+            },
+            "local_files": {
+                "items": [
+                {
+                    "uri_file": "file://FILENAME_PLACEHOLDER"
+                }
+                ]
+            }
+            }
+        }}
+        ]
+    }
+    """
+
+    path = os.path.join(str(tmpdir), 'substrait_data.arrow')

Review Comment:
   Adding it as 
   
   ```python
   path = os.path.join(str(tmpdir), 'substrait_data.ipc')
   ```
   
   Error (Since we don't support it). Should we resolve this here as well? Or 
follow this up in another PR?
   
   ```bash
   aise ArrowNotImplementedError(message)
   E   pyarrow.lib.ArrowNotImplementedError: 
substrait::ReadRel::LocalFiles::FileOrFiles::format other than 
FILE_FORMAT_PARQUET
   E   
/Users/vibhatha/github/fork/arrow/cpp/src/arrow/engine/substrait/serde.cc:73  
FromProto(plan_rel.rel(), ext_set)
   E   
/Users/vibhatha/github/fork/arrow/cpp/src/arrow/engine/substrait/util.cc:95  
engine::DeserializePlan(substrait_buffer, consumer_factory)
   E   
/Users/vibhatha/github/fork/arrow/cpp/src/arrow/engine/substrait/util.cc:116  
executor.Init(substrait_buffer)
   ```



-- 
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]

Reply via email to