|
2 | 2 | Base and utility classes for tseries type pandas objects.
|
3 | 3 | """
|
4 | 4 | import operator
|
| 5 | +from typing import Set |
5 | 6 | import warnings
|
6 | 7 |
|
7 | 8 | import numpy as np
|
@@ -62,14 +63,17 @@ class DatetimeIndexOpsMixin(ExtensionOpsMixin):
|
62 | 63 | # DatetimeLikeArrayMixin assumes subclasses are mutable, so these are
|
63 | 64 | # properties there. They can be made into cache_readonly for Index
|
64 | 65 | # subclasses bc they are immutable
|
65 |
| - inferred_freq = cache_readonly(DatetimeLikeArrayMixin.inferred_freq.fget) |
66 |
| - _isnan = cache_readonly(DatetimeLikeArrayMixin._isnan.fget) |
67 |
| - hasnans = cache_readonly(DatetimeLikeArrayMixin._hasnans.fget) |
| 66 | + inferred_freq = cache_readonly( |
| 67 | + DatetimeLikeArrayMixin.inferred_freq.fget) # type: ignore |
| 68 | + _isnan = cache_readonly(DatetimeLikeArrayMixin._isnan.fget) # type: ignore |
| 69 | + hasnans = cache_readonly( |
| 70 | + DatetimeLikeArrayMixin._hasnans.fget) # type: ignore |
68 | 71 | _hasnans = hasnans # for index / array -agnostic code
|
69 |
| - _resolution = cache_readonly(DatetimeLikeArrayMixin._resolution.fget) |
70 |
| - resolution = cache_readonly(DatetimeLikeArrayMixin.resolution.fget) |
| 72 | + _resolution = cache_readonly( |
| 73 | + DatetimeLikeArrayMixin._resolution.fget) # type: ignore |
| 74 | + resolution = cache_readonly( |
| 75 | + DatetimeLikeArrayMixin.resolution.fget) # type: ignore |
71 | 76 |
|
72 |
| - _box_values = ea_passthrough(DatetimeLikeArrayMixin._box_values) |
73 | 77 | _maybe_mask_results = ea_passthrough(
|
74 | 78 | DatetimeLikeArrayMixin._maybe_mask_results)
|
75 | 79 | __iter__ = ea_passthrough(DatetimeLikeArrayMixin.__iter__)
|
@@ -131,11 +135,11 @@ def _ndarray_values(self):
|
131 | 135 | # Abstract data attributes
|
132 | 136 |
|
133 | 137 | @property
|
134 |
| - def values(self) -> np.ndarray: |
| 138 | + def values(self): |
135 | 139 | # Note: PeriodArray overrides this to return an ndarray of objects.
|
136 | 140 | return self._data._data
|
137 | 141 |
|
138 |
| - @property |
| 142 | + @property # type: ignore # https://github.com/python/mypy/issues/1362 |
139 | 143 | @Appender(DatetimeLikeArrayMixin.asi8.__doc__)
|
140 | 144 | def asi8(self):
|
141 | 145 | return self._data.asi8
|
@@ -762,9 +766,9 @@ class DatetimelikeDelegateMixin(PandasDelegate):
|
762 | 766 | boxed in an index, after being returned from the array
|
763 | 767 | """
|
764 | 768 | # raw_methods : dispatch methods that shouldn't be boxed in an Index
|
765 |
| - _raw_methods = set() |
| 769 | + _raw_methods = set() # type: Set[str] |
766 | 770 | # raw_properties : dispatch properties that shouldn't be boxed in an Index
|
767 |
| - _raw_properties = set() |
| 771 | + _raw_properties = set() # type: Set[str] |
768 | 772 | name = None
|
769 | 773 | _data = None
|
770 | 774 |
|
|
0 commit comments