-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
BUG: is_string_dtype(pd.Index([], dtype='O')) returns False #54997
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
Changes from 3 commits
1426611 73962fd 91c8b2a 96680cb db0dcdd d163e71 46aafed d076edb d4a54b4 8ea61bd 3945bb0 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -1212,3 +1212,8 @@ def test_multi_column_dtype_assignment(): | |
| | ||
| df["b"] = 0 | ||
| tm.assert_frame_equal(df, expected) | ||
| | ||
| | ||
| def test_empty_object_array_is_string_dtype(): | ||
| ||
| # GH #54661 | ||
| ||
| assert is_string_dtype(pd.Index([], dtype="O")) | ||
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 the bug in is_all_strings or is_string_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.
I think, the bug is in
is_all_strings, but we don’ t have this function in api and users see the bug while callingis_string_dtype. That is why I replaced Bug in :func:is_all_stringswith: Bug in :func:is_string_dtype.Looks like we don’t have a test for is_all_strings, do we need one?
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 meant the user-facing bug. in the docs we generally only reference public functions/methods
Uh oh!
There was an error while loading. Please reload this page.
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.
okay, thank you. I removed from
doc/source/whatsnew/v2.2.0.rstmy line.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.
@jbrockmendel, I updated the PR. Could you please take a look at it.
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 think we still want a note, it just needs to refer to is_string_dtype, which I think is public
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.
Yeah,
is_string_dtypeis a public function, I added the note tov2.1.1.rst. I think my change is a minor and we can put it in the version 2.1.1