Skip to content

Review expected failures #217

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

Closed
Dr-Irv opened this issue Aug 22, 2022 · 1 comment · Fixed by #488
Closed

Review expected failures #217

Dr-Irv opened this issue Aug 22, 2022 · 1 comment · Fixed by #488

Comments

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Aug 22, 2022

In #213 @twoertwein marked typing tests that we expect to fail using TYPE_CHECKING_INVALID_USAGE . The idea here is that we are testing code that we want the type checkers to pick up as being incorrect. In many cases, pyright does figure that out. mypy figures it out sometimes, and there are occasions where both type checkers see what we expect to fail as "correct" code.

At some point in time in the past, when the stubs were in the Microsoft repository, those tests were doing the "right" thing, i.e., both type checkers were marking those tests as "failures", and the # type: ignore comments were correct, in the sense that the type checkers saw that they were correct ignores.

Now, possibly due to changes in the settings used for mypy and pyright, as well as evolutions in the type checkers themselves, those tests are no longer failing as we expect them to. Some investigation is required to determine whether this is due to something changing in the stubs, or to particular settings in the type checkers.

@twoertwein
Copy link
Member

twoertwein commented Aug 23, 2022

I think why

ssum: pd.Series = s1 + s2 # TODO both: ignore[operator]

works might be because of this overload
self, other: num | _str | Timedelta | _ListLike | Series[S1]

Would need type ignores but it might work to have an overload before this fallback overload of TimestampSeries + TimestampSeries -> NoReturn. This would overlap with the last overload (ignore in pandas-stubs) but it should be correctly parsed by mypy/pyright when testing external code as type checkers will use the first matching overload.

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 a pull request may close this issue.

2 participants