-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: some types for pandas/core/arrays/sparse/dtype.py #29899
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
TYP: some types for pandas/core/arrays/sparse/dtype.py #29899
Conversation
pandas/core/arrays/sparse/dtype.py
Outdated
@@ -223,7 +223,7 @@ def construct_from_string(cls, string): | |||
raise TypeError(msg) | |||
|
|||
@staticmethod | |||
def _parse_subtype(dtype): | |||
def _parse_subtype(dtype) -> Tuple[str, Union[str, bool]]: |
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.
not necessarily for this PR, but the Union[str, bool]
is kind of weird. maybe split into separate return values with clearer types?
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 dtype
be typed as str
?
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.
maybe we could cast has_fill_value to bool before returning. cast as in the dynamic bool(...) sense not cast from typing?
Pending typing |
Thanks ! |
broken off #28339