-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
DEPR: require SparseDtype.fill_value be compatible with SparseDtype.subtype #53043
DEPR: require SparseDtype.fill_value be compatible with SparseDtype.subtype #53043
Conversation
stacklevel=find_stack_level(), | ||
) | ||
elif isinstance(self.subtype, CategoricalDtype): | ||
# TODO: is this even supported? It is reached in |
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 could see it being reasonable to have a fill value for a Categorical that's not a current category but is the same type as the current categories
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.
in principle i guess, but i think this case existing at all is wrong. SparseArray._sparse_values has to be np.ndarray, and the dtype is initialized with self._dtype = SparseDtype(sparse_values.dtype, fill_value)
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.
will make a separate PR to disallow this case
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.
#53160 disallows this case
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.
should no longer be an issue now that #53160 is merged
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.
woops, should have updated to remove this check. will do in a follow-up
Thanks @jbrockmendel |
…ubtype (pandas-dev#53043) * DEPR: require SparseDtype.fill_value be compatible with SparseDtype.subtype * filter more specific
…ubtype (pandas-dev#53043) * DEPR: require SparseDtype.fill_value be compatible with SparseDtype.subtype * filter more specific
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.