-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG: setitem into td64/dt64 series/frame with Categorical[strings] #44236
Conversation
jbrockmendel
commented
Oct 30, 2021
•
edited
Loading
edited
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
pandas/core/arrays/datetimelike.py
Outdated
) | ||
elif isinstance(dtype, CategoricalDtype): | ||
return dtype.categories.inferred_type == "string" | ||
return dtype == "string" |
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.
what hits here, other EAs? but not numpy types e.g. np.str
would be above, right?
maybe a comment to this effect
pandas/core/arrays/datetimelike.py
Outdated
dtype = value.dtype | ||
|
||
if isinstance(dtype, np.dtype): | ||
return ( |
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.
shoudn't this be in core.dtypes.common?
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: |
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.
wouldn't hurt to add some unit tests for this when you have a chance :->