Skip to content

make sub of timedelta work #759

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

Merged
merged 6 commits into from
Aug 2, 2023
Merged

Conversation

Dr-Irv
Copy link
Collaborator

@Dr-Irv Dr-Irv commented Aug 2, 2023

Copy link
Member

@twoertwein twoertwein left a comment

Choose a reason for hiding this comment

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

Looks good to me but there might be a numpy-pyright error

@Dr-Irv
Copy link
Collaborator Author

Dr-Irv commented Aug 2, 2023

Looks good to me but there might be a numpy-pyright error

Actually, it was an issue with pyright 1.1.320. Needed to test differently on mypy vs. pyright, which I figured out how to do. Take another look


SupportsRichComparison: TypeAlias = Any
else:
from _typeshed import SupportsRichComparison # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind referencing an issue or describing the discrepancy? Is it just that mypy has an older version of typestubs?

Copy link
Member

Choose a reason for hiding this comment

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

Does this also work for poe mypy --mypy_nightly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added comments in 5310eb6

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Does this also work for poe mypy --mypy_nightly?

Looks like it did!

We may want to use this pattern (MYPY_CHECKING) elsewhere when mypy and pyright make different inferences. Can't put it in the stubs themselves - that would require users to define MYPY_CHECKING as false if using pyright, but we can use it in our tests.

@twoertwein twoertwein merged commit 8957328 into pandas-dev:main Aug 2, 2023
@twoertwein
Copy link
Member

Thanks @Dr-Irv !

@Dr-Irv Dr-Irv deleted the sub_timedelta branch December 2, 2024 20:23
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.

No overload variant of "__sub__" of "Series" matches argument type "Timedelta"
2 participants