Skip to content

Commit 169cc10

Browse files
authored
CLN: datetimelike setops (#41750)
1 parent ea38121 commit 169cc10

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pandas/core/indexes/datetimelike.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,6 @@ def is_type_compatible(self, kind: str) -> bool:
631631
# --------------------------------------------------------------------
632632
# Set Operation Methods
633633

634-
def _difference(self, other, sort=None):
635-
new_idx = super()._difference(other, sort=sort)._with_freq(None)
636-
return new_idx
637-
638634
def _intersection(self, other: Index, sort=False) -> Index:
639635
"""
640636
intersection specialized to the case with matching dtypes.
@@ -780,13 +776,8 @@ def _union(self, other, sort):
780776

781777
if self._can_fast_union(other):
782778
result = self._fast_union(other, sort=sort)
783-
if sort is None:
784-
# In the case where sort is None, _can_fast_union
785-
# implies that result.freq should match self.freq
786-
assert result.freq == self.freq, (result.freq, self.freq)
787-
elif result.freq is None:
788-
# TODO: no tests rely on this; needed?
789-
result = result._with_freq("infer")
779+
# in the case with sort=None, the _can_fast_union check ensures
780+
# that result.freq == self.freq
790781
return result
791782
else:
792783
i8self = Int64Index._simple_new(self.asi8)

0 commit comments

Comments
 (0)