westonpace commented on code in PR #14024: URL: https://github.com/apache/arrow/pull/14024#discussion_r962420622
########## python/pyarrow/_substrait.pyx: ########## @@ -25,14 +26,84 @@ from pyarrow.includes.libarrow cimport * from pyarrow.includes.libarrow_substrait cimport * -def run_query(plan): +cdef shared_ptr[CTable] _process_named_table(dict named_args, const std_vector[c_string]& names): + cdef: + c_string c_name + shared_ptr[CTable] empty_table + py_names = [] + + # provider function could raise an exception + try: + for i in range(names.size()): + c_name = names[i] + py_names.append(frombytes(c_name)) + return pyarrow_unwrap_table(named_args["provider"](py_names)) + except Exception: + return empty_table Review Comment: BindFunction used SafeCallIntoPython. I think what you suggested was good. -- 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