Skip to content

Commit 513f343

Browse files
fix insert
1 parent 249a42f commit 513f343

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/indexes/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6248,8 +6248,10 @@ def _find_common_type_compat(self, target) -> DtypeObj:
62486248
isinstance(self, RangeIndex) or self.dtype == np.object_
62496249
):
62506250
return target_dtype
6251-
if len(target) == 0 and (
6252-
isinstance(target, RangeIndex) or target_dtype == np.object_
6251+
if (
6252+
isinstance(target, Index)
6253+
and len(target) == 0
6254+
and (isinstance(target, RangeIndex) or target_dtype == np.object_)
62536255
):
62546256
return self.dtype
62556257

0 commit comments

Comments
 (0)