-
-
Notifications
You must be signed in to change notification settings - Fork 157
type *core/base.pyi, remove SelectionMixin
#1567
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
type *core/base.pyi, remove SelectionMixin
#1567
Conversation
loicdiridollou
left a comment
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.
Nice clean up, minor question on whether it is worth keeping the function that uses the field you have dropped since not documented, open to discussion. Thanks @MarcoGorelli
tests/test_resampler.py
Outdated
| ) -> DataFrame: | ||
| assert isinstance(res, DatetimeIndexResampler) | ||
| return res.obj | ||
| return res.obj # type: ignore[return-value] # pyright: ignore[reportReturnType] |
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.
Since this is not documented is there a good reason to keep a function like this? The user should not in theory access the field anyway.
tests/test_resampler.py
Outdated
| def k(x: int, t: "DatetimeIndexResampler[DataFrame]") -> DataFrame: | ||
| assert isinstance(x, int) | ||
| return t.obj | ||
| return t.obj # type: ignore[return-value] # pyright: ignore[reportReturnType] |
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.
Same here, since not documented is there a good reason to keep it? Or could we replace it with a function that use "allowed" fields to keep the same type coverage.
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.
sure, it's just used here to test pipe so might as well not use obj 👍
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.
Okay so we can keep it for now
loicdiridollou
left a comment
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.
Let's merge this, thanks @MarcoGorelli
SelectionMixinis undocumented, and its methods are:obj: undocumentedexclusions: undocumentedndim: undocumented__getitem__: overwritten by subclassesBaseGroupByandBaseWindowaggregate: overwritten by subclassesDataFrameGroupBy,SeriesGroupBy, andBaseWindowCloses #xxxx (Replace xxxx with the Github issue number)
Tests added (Please use
assert_type()to assert the type of any return value)If I used AI to develop this pull request, I prompted it to follow
AGENTS.md.