You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2024/03/19 16:51:46 UTC

Re: [I] BUG: Empty slicing an array backwards beyond the start should be empty [arrow]

jorisvandenbossche commented on issue #40642:
URL: https://github.com/apache/arrow/issues/40642#issuecomment-2007675276

   Thanks for the catch! Yet another annoying corner case ..
   
   I was wondering if there isn't some existing functionality to "normalize" slice objects, and https://stackoverflow.com/questions/6246084/sanitize-python-slice pointed to https://docs.python.org/3/reference/datamodel.html#slice.indices
   
   We could test if that helps for us. Although for the case above it still gives negative start/stop values .. :
   
   ```
   In [3]: slice(-6, -6, -1).indices(5)
   Out[3]: (-1, -1, -1)
   ```


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org