amol- commented on pull request #11185: URL: https://github.com/apache/arrow/pull/11185#issuecomment-923919180
> > I'll have to tweak numpy_to_arrow.cc too to deal with the situation where the array is a numpy one but the mask is not. > > Wouldn't it be simpler to at that point do a `mask = np.asarray(mask)` or the like in the cython code (at that point we know that numpy is available), instead of making the numpy_to_arrow case more complex to handle generic sequence types? > > That would also allow to keep some more code in cython (like the dimensionality and length check) It would, but I thought we didn't want to go that way as it would mean scanning the mask twice (once to convert it to numpy, once to make the bitmap), thus introducing a slowdown when something different from a numpy arrays is used as a mask. At that point it would probably make sense to just raise a `"mask must be a numpy array when data is a numpy array"` error and make the user explicitly deal with the overhead -- 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]
