Skip to content

Conversation

@loicdiridollou
Copy link
Member

@loicdiridollou
Copy link
Member Author

/pandas_nightly

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding mean, min, median. I think we just need to relax the type testing.

skipna: _bool | None = True,
numeric_only: _bool = False,
**kwargs: Any,
) -> Scalar: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably further restrict to _OrderableT from pandas-stubs/_libs/intervals.pyi, instead of just Scalar. But this can be done in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a type that can be returned? I thought it was more of a generic for Interval or something like that. I have left it for later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, either. @Dr-Irv can we return _OrderableT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, either. @Dr-Irv can we return _OrderableT?

We can't return a TypeVar when the TypeVar is not part of the Generic in the class.

But we can create a new type that is a union of what is in _OrderableT , and that might be a better result here.

Although be careful. Because _OrderableT doesn't include str, which could be the result of max and min. Would need to check the other scalar types as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think it may be too much hair-splitting to refine further here.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Thank you @loicdiridollou !

skipna: _bool | None = True,
numeric_only: _bool = False,
**kwargs: Any,
) -> Scalar: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, either. @Dr-Irv can we return _OrderableT?

@cmp0xff cmp0xff merged commit ad8cae5 into pandas-dev:main Nov 17, 2025
16 checks passed
@loicdiridollou loicdiridollou deleted the gh1488_df_max branch November 25, 2025 02:49
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.

DataFrame.max needs the same overloads as DataFrame.any has

3 participants