Skip to content

Commit 1c7693b

Browse files
authored
PERF: DatetimeIndex.union (#42353)
1 parent 28476ff commit 1c7693b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pandas/core/indexes/datetimelike.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
NDArrayBackedExtensionIndex,
6565
inherit_names,
6666
)
67-
from pandas.core.indexes.numeric import Int64Index
6867
from pandas.core.tools.timedeltas import to_timedelta
6968

7069
if TYPE_CHECKING:
@@ -678,8 +677,4 @@ def _union(self, other, sort):
678677
# that result.freq == self.freq
679678
return result
680679
else:
681-
i8self = Int64Index._simple_new(self.asi8)
682-
i8other = Int64Index._simple_new(other.asi8)
683-
i8result = i8self._union(i8other, sort=sort)
684-
result = type(self)(i8result, dtype=self.dtype, freq="infer")
685-
return result
680+
return super()._union(other, sort)._with_freq("infer")

0 commit comments

Comments
 (0)