You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/06 09:13:06 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #14331: ARROW-17944: [Python] substrait.run_query accept bytes/Buffer and not segfault

jorisvandenbossche commented on code in PR #14331:
URL: https://github.com/apache/arrow/pull/14331#discussion_r988765977


##########
python/pyarrow/tests/test_substrait.py:
##########
@@ -74,12 +76,22 @@ def test_run_serialized_query(tmpdir):
     """
 
     file_name = "read_data.arrow"
-    table = pa.table([[1, 2, 3, 4, 5]], names=['foo'])
+    table = pa.table([[1, 2, 3, 4, 5]], names=["foo"])
     path = _write_dummy_data_to_disk(tmpdir, file_name, table)
     query = tobytes(substrait_query.replace("FILENAME_PLACEHOLDER", path))
 
     buf = pa._substrait._parse_json_plan(query)
 
+    # Passing unsupported type, like int, will not segfault.
+    if input_type == "unsupported":
+        with pytest.raises(TypeError, match="No matching signature found"):
+            substrait.run_query(1)
+        return

Review Comment:
   Since this part doesn't use anything of the rest of the test (it doesn't require any of the variables that is set up above), I would personally just put this in its own test instead of relying on parametrization



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org