-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST/BUG (string dtype): Fix and adjust indexes string tests #59544
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 4 commits
b6f7130
37252ef
093fede
fcfefdb
d716472
fb5718e
e0878ce
460e60a
5516275
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 |
---|---|---|
|
@@ -504,7 +504,8 @@ def __new__( | |
|
||
elif is_ea_or_datetimelike_dtype(dtype): | ||
# non-EA dtype indexes have special casting logic, so we punt here | ||
pass | ||
if isinstance(data, (set, frozenset)): | ||
data = list(data) | ||
Comment on lines
506
to
+508
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is related to what you mentioned on slack, I assume?
Whether we consider a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, correct. It#s explicitly allowed for Index, so we shouldn't break this now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, for |
||
|
||
elif is_ea_or_datetimelike_dtype(data_dtype): | ||
pass | ||
|
@@ -6877,6 +6878,9 @@ def insert(self, loc: int, item) -> Index: | |
# We cannot keep the same dtype, so cast to the (often object) | ||
# minimal shared dtype before doing the insert. | ||
dtype = self._find_common_type_compat(item) | ||
if dtype == self.dtype: | ||
# EA's might run into recursion errors if loc is invalid | ||
raise | ||
return self.astype(dtype).insert(loc, item) | ||
|
||
if arr.dtype != object or not isinstance( | ||
|
Uh oh!
There was an error while loading. Please reload this page.