-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Assorted cleanups #28563
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
CLN: Assorted cleanups #28563
Conversation
@@ -743,7 +742,7 @@ def value_counts( | |||
|
|||
else: | |||
|
|||
if is_extension_array_dtype(values) or is_sparse(values): | |||
if is_extension_array_dtype(values): |
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 everyone's edification: why can we remove this check?
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.
is_sparse is a subset of is_extension_array_dtype
subarr = dtype.construct_array_type()( | ||
arr, dtype.categories, ordered=dtype._ordered | ||
) | ||
elif is_extension_array_dtype(dtype): | ||
# create an extension array from its dtype | ||
dtype = cast(ExtensionDtype, dtype) |
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 everyone's edification: why are we doing this? Same for the similar cast a few lines above.
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.
This is to keep mypy from complaining
thanks @jbrockmendel |
No description provided.