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


##########
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:
   ya, I initially had that, but thought if it's ever changed or relocated this 
would be outdated. I agree it's prettier though.



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to