-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: Add support for series[other_series]
#2013
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.
Moved all the __getitem__
tests previously in slice_test.py
@@ -156,7 +159,9 @@ def __getitem__(self: Self, idx: int | slice | Sequence[int]) -> Any | Self: | |||
is_numpy_scalar(idx) and idx.dtype.kind in ("i", "u") | |||
): | |||
return self._compliant_series[idx] | |||
return self._from_compliant_series(self._compliant_series[idx]) | |||
return self._from_compliant_series( | |||
self._compliant_series[to_native(idx, pass_through=True)] |
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.
Kind of unrelated, but we have a method called _extract_native
which actually (maybe) extracts compliant π
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.
that's an awfully good point
series[other_series]
series[other_series]
π¨ #2013 (comment) |
Took me 10 seconds to figure out what changed π thanks a ton π€© |
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.
thanks for doing this! just got a question
@@ -156,7 +159,9 @@ def __getitem__(self: Self, idx: int | slice | Sequence[int]) -> Any | Self: | |||
is_numpy_scalar(idx) and idx.dtype.kind in ("i", "u") | |||
): | |||
return self._compliant_series[idx] | |||
return self._from_compliant_series(self._compliant_series[idx]) | |||
return self._from_compliant_series( | |||
self._compliant_series[to_native(idx, pass_through=True)] |
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.
that's an awfully good point
@pytest.mark.filterwarnings( | ||
"ignore:.*_array__ implementation doesn't accept a copy keyword.*:DeprecationWarning:modin" | ||
) |
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.
is this just something that Modin calls (on itself?) internally? not anything we need to concern ourselves with?
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.
Yes, it traces back to modin/pandas/indexing.py
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.
Reviewing from my phone but should be good thanks @FBruzzesi !
What type of PR is this? (check all applicable)
Related issues
Checklist
If you have comments or can explain your changes, please do so below