westonpace commented on code in PR #14320:
URL: https://github.com/apache/arrow/pull/14320#discussion_r1060856287


##########
python/pyarrow/src/arrow/python/udf.cc:
##########
@@ -99,22 +99,33 @@ Status RegisterScalarFunction(PyObject* user_function, 
ScalarUdfWrapperCallback
   auto scalar_func = std::make_shared<compute::ScalarFunction>(
       options.func_name, options.arity, options.func_doc);
   Py_INCREF(user_function);
-  std::vector<compute::InputType> input_types;
-  for (const auto& in_dtype : options.input_types) {
-    input_types.emplace_back(in_dtype);
+
+  const size_t num_kernels = options.input_arg_types.size();
+  // number of input_type variations and output_types must be
+  // equal in size
+  if(num_kernels != options.output_types.size()) {
+    return Status::Invalid("input_arg_types and output_types should be equal 
in size");
+  }
+  // adding kernels
+  for(size_t idx=0 ; idx < num_kernels; idx++) {

Review Comment:
   ```suggestion
     for(size_t idx=0; idx < num_kernels; idx++) {
   ```



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