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


##########
python/pyarrow/_substrait.pyx:
##########
@@ -124,7 +124,13 @@ def run_query(plan, table_provider=None):
         function[CNamedTableProvider] c_named_table_provider
         CConversionOptions c_conversion_options
 
-    c_buf_plan = pyarrow_unwrap_buffer(plan)
+    if isinstance(plan, bytes):
+        c_buf_plan = pyarrow_unwrap_buffer(py_buffer(plan))
+    elif isinstance(plan, Buffer):
+        c_buf_plan = pyarrow_unwrap_buffer(plan)
+    else:
+        raise TypeError(
+            f"Expected '{Buffer}' or bytes, got '{type(plan)}'")

Review Comment:
   > if it's ever changed or relocated
   
   I think that's quite unlikely



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