milesgranger commented on code in PR #14331:
URL: https://github.com/apache/arrow/pull/14331#discussion_r989082209
##########
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:
~maybe `{Buffer.__module__}.{Buffer.__class__.__name__}`?~ :sweat_smile:
I'll change it to `pyarrow.Buffer` :+1:
--
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]