edponce commented on a change in pull request #11147:
URL: https://github.com/apache/arrow/pull/11147#discussion_r713245188
##########
File path: python/pyarrow/_compute.pyx
##########
@@ -904,59 +885,71 @@ class TakeOptions(_TakeOptions):
cdef class _PartitionNthOptions(FunctionOptions):
- def _set_options(self, int64_t pivot):
+ def _set_options(self, pivot):
self.wrapped.reset(new CPartitionNthOptions(pivot))
class PartitionNthOptions(_PartitionNthOptions):
- def __init__(self, int64_t pivot):
+ def __init__(self, pivot):
self._set_options(pivot)
cdef class _MakeStructOptions(FunctionOptions):
- def _set_options(self, field_names):
+ def _set_options(self, field_names, field_nullability, field_metadata):
cdef:
vector[c_string] c_field_names
- for n in field_names:
- c_field_names.push_back(tobytes(n))
- self.wrapped.reset(new CMakeStructOptions(c_field_names))
+ vector[shared_ptr[const CKeyValueMetadata]] c_field_metadata
+ for name in field_names:
+ c_field_names.push_back(tobytes(name))
+ for metadata in field_metadata:
+ c_field_metadata.push_back(pyarrow_unwrap_metadata(metadata))
+ self.wrapped.reset(
+ new CMakeStructOptions(c_field_names,
+ field_nullability,
+ c_field_metadata))
class MakeStructOptions(_MakeStructOptions):
- def __init__(self, field_names):
- self._set_options(field_names)
+ def __init__(self, field_names, field_nullability=None,
Review comment:
`MakeStructOptions` was updated recently with additional mandatory
parameters. All arguments are mandatory (see [C++
definition](https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/api_scalar.h#L300-L303)),
so I think we should leave them positional here as well.
--
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]