-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for (start<0 & stop>0) in slice #4076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth having a pair of ticking/refreshing tests that ensure correctness. One that shrinks the source table to empty, and another that grows the source table until the slice is empty.
Labels indicate documentation is required. Issues for documentation have been opened: How-to: https://github.com/deephaven/deephaven.io/issues/2902 |
Feature request, closes #3130
Change description: Earlier, an error was generated in this scenario. After this change, a subset of rows will be returned where start will be counted from the end of table (inclusively) and stop from the beginning. This change also fixes one bug where ADD_ONLY was incorrectly being propagated from parent to a child table in case of slice operation.
Documentation update: We need to update both the java and python documentation to reflect this change.
Earlier, if (start<0 & stop>0), an error was generated. Now, a subset of rows will be returned. For example, slice(-3, 5)
will return all rows starting from the third-last row to the fifth row of the table. If there are no rows between these positions, the function will return an empty table.
Note that index 5 corresponds to the sixth row in the table, so we are excluding the sixth row and ending the subset at the fifth row.