-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pandas-dev#28926 Mypy fix/extension json array #28989
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
Changes from 2 commits
38dee63
974f0ee
5c87147
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
class JSONDtype(ExtensionDtype): | ||
type = abc.Mapping | ||
name = "json" | ||
na_value = UserDict() | ||
na_value = UserDict() # type: UserDict | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you type this as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So since this test is for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will produce There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is OK. probably better than Mapping. just needs to be quoted for py3.6 |
||
|
||
@classmethod | ||
def construct_array_type(cls): | ||
|
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.
@simonjayhawkins i know ive asked you this before, but why cant mypy figure this out on its own?
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.
the revealed type for na_value is
Revealed type is 'collections.UserDict[Any, Any]'
.mypy asks for more info to narrow the
Any