Skip to content

Conversation

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Dec 18, 2025

SelectionMixin is undocumented, and its methods are:

  • obj: undocumented

  • exclusions: undocumented

  • ndim: undocumented

  • __getitem__: overwritten by subclasses BaseGroupBy and BaseWindow

  • aggregate: overwritten by subclasses DataFrameGroupBy, SeriesGroupBy, and BaseWindow

  • Closes #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.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 18, 2025 11:44
Copy link
Member

@loicdiridollou loicdiridollou left a 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

) -> DataFrame:
assert isinstance(res, DatetimeIndexResampler)
return res.obj
return res.obj # type: ignore[return-value] # pyright: ignore[reportReturnType]
Copy link
Member

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.

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]
Copy link
Member

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.

Copy link
Member Author

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 👍

Copy link
Member

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

Copy link
Member

@loicdiridollou loicdiridollou left a 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

@loicdiridollou loicdiridollou merged commit 6d02ca8 into pandas-dev:main Dec 18, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants