westonpace commented on issue #32439: URL: https://github.com/apache/arrow/issues/32439#issuecomment-1690125639
@mikelui > In the blanket implementation of Array::Slice, only the offset and length of the underying ArrayData is modified. > whether the Slice is actually what we want (do we want to keep the extra data around?) If memory serves this is correct (I am not quite 100% certain of this paragraph but "fairly confident" :) maybe someone else will confirm) and intended behavior. The length of a parent array may be shorted than the length of a child array. Offsets are cumulative so if a parent array has offset 10 and a child array has offset 5 then the memory location that is looked at for the 0th value will be the 15th slot. > EDIT: Actually I think I can make it work by overriding ToArray(length) in the PyConverters and doing some logic to check if shrinking is necessary. It still would be essentially a custom Slice implementation. But, it at least constrains the scope to just the python -> arrow conversions. I'll work on a PR soon. I'm not very familiar with the python converters. However, I think we have a good amount of regression tests. If you can get them to pass while passing this case then you are probably on the right track. -- 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]
