Skip to content

BUG: setitem into td64/dt64 series/frame with Categorical[strings] #44236

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

Merged

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Oct 30, 2021

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

)
elif isinstance(dtype, CategoricalDtype):
return dtype.categories.inferred_type == "string"
return dtype == "string"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what hits here, other EAs? but not numpy types e.g. np.str would be above, right?

maybe a comment to this effect

dtype = value.dtype

if isinstance(dtype, np.dtype):
return (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoudn't this be in core.dtypes.common?

@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label Oct 30, 2021
@jreback
Copy link
Contributor

jreback commented Oct 30, 2021

this a user facing bug?

@jbrockmendel
Copy link
Member Author

this a user facing bug?

yes, updated with whatsnew

@@ -1788,3 +1789,23 @@ def pandas_dtype(dtype) -> DtypeObj:
raise TypeError(f"dtype '{dtype}' not understood")

return npdtype


def is_all_strings(value: ArrayLike) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't hurt to add some unit tests for this when you have a chance :->

@jreback jreback added this to the 1.4 milestone Nov 1, 2021
@jreback jreback merged commit cb83977 into pandas-dev:master Nov 1, 2021
@jbrockmendel jbrockmendel deleted the ref-dtlike-can_hold_element-3 branch November 1, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants