-
-
Notifications
You must be signed in to change notification settings - Fork 147
Type NAType
#1348
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 NAType
#1348
Conversation
@MarcoGorelli pine me when I should review |
sure @Dr-Irv , happy for you to take a look, thanks! |
…ndex` as they return `NotImplemented`
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.
For the orthogonal issue, can you add a comment in #1347 that says that this file will have to be updated as part of addressing that issue?
Otherwise looks good. Just some small stuff
tests/test_natype.py
Outdated
# ), | ||
# tuple, | ||
# ) | ||
check(assert_type(na.__divmod__(1), tuple[NAType, NAType]), tuple) |
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.
i couldn't understand why, but this one fails if I write divmod(na, 1)
instead, with
/home/marcogorelli/pandas-stubs-dev/tests/test_natype.py:105:23 - error: No overloads for "divmod" match the provided arguments (reportCallIssue)
/home/marcogorelli/pandas-stubs-dev/tests/test_natype.py:105:23 - error: "assert_type" mismatch: expected "tuple[NAType, NAType]" but received "Unknown" (reportAssertTypeFailure)
/home/marcogorelli/pandas-stubs-dev/tests/test_natype.py:105:34 - error: Argument of type "Literal[1]" cannot be assigned to parameter "y" of type "SupportsRDivMod[_T_contra@divmod, _T_co@divmod]" in function "divmod"
"Literal[1]" is incompatible with protocol "SupportsRDivMod[NAType, _T_co@divmod]"
"__rdivmod__" is an incompatible type
Type "(value: int, /) -> tuple[int, int]" is not assignable to type "(other: _T_contra@SupportsRDivMod, /) -> _T_co@SupportsRDivMod"
Parameter 1: type "_T_contra@SupportsRDivMod" is incompatible with type "int"
"NAType" is not assignable to "int" (reportArgumentType)
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.
New pyright
bug. microsoft/pyright#10899
Let's wait to get that resolved.
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.
thanks for reporting to them
looks like they haven't responded - reckon it's ok to revisit this detail later and move forwards with the rest for now? there's the issue open in their repo to track it
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.
Can you add a comment referring to the pyright issue?
Probably best to keep the test as divmod(na, 1)
and put in a #pyright :ignore
there
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.
thanks @MarcoGorelli
This has uncovered a couple of bugs:
so some tests have their assertions ignored for now, but i've linked to them in those places