Skip to content

Commit 5035f14

Browse files
committed
mypy fixup
1 parent 0697606 commit 5035f14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ def __getitem__(self, key: PositionalIndexer2D) -> Self | DTScalarOrNaT:
393393
else:
394394
# At this point we know the result is an array.
395395
result = cast(Self, result)
396-
result._freq = self._get_getitem_freq(key)
396+
# error: Incompatible types in assignment (expression has type
397+
# "BaseOffset | None", variable has type "None")
398+
result._freq = self._get_getitem_freq(key) # type: ignore[assignment]
397399
return result
398400

399401
def _get_getitem_freq(self, key) -> BaseOffset | None:
@@ -2046,7 +2048,7 @@ def _maybe_pin_freq(self, freq, validate_kwds: dict) -> None:
20462048
if self._freq is None:
20472049
# Set _freq directly to bypass duplicative _validate_frequency
20482050
# check.
2049-
self._freq = to_offset(self.inferred_freq)
2051+
self._freq = to_offset(self.inferred_freq) # type: ignore[assignment]
20502052
elif freq is lib.no_default:
20512053
# user did not specify anything, keep inferred freq if the original
20522054
# data had one, otherwise do nothing
@@ -2446,7 +2448,7 @@ def take(
24462448

24472449
if isinstance(maybe_slice, slice):
24482450
freq = self._get_getitem_freq(maybe_slice)
2449-
result._freq = freq
2451+
result._freq = freq # type: ignore[assignment]
24502452

24512453
return result
24522454

0 commit comments

Comments
 (0)