-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: avoid inherit_names for DatetimeIndexOpsMixin #48015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1f7a03b
dafc87d
d3a4430
40b8d11
8cd32e8
a426868
05c7e0f
69da6f5
b00e440
f2af929
4723a9b
0f0fb06
2ed057d
95d2db9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,8 +167,7 @@ def _engine_type(self) -> type[libindex.PeriodEngine]: | |
return libindex.PeriodEngine | ||
|
||
@cache_readonly | ||
# Signature of "_resolution_obj" incompatible with supertype "DatetimeIndexOpsMixin" | ||
def _resolution_obj(self) -> Resolution: # type: ignore[override] | ||
def _resolution_obj(self) -> Resolution: | ||
# for compat with DatetimeIndex | ||
return self.dtype._resolution_obj | ||
|
||
|
@@ -393,7 +392,7 @@ def is_full(self) -> bool: | |
if not self.is_monotonic_increasing: | ||
raise ValueError("Index is not monotonic") | ||
values = self.asi8 | ||
return ((values[1:] - values[:-1]) < 2).all() | ||
return ((values[1:] - values[:-1]) < 2).all().item() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed? seems like the kind of thing that might be fragile across numpy versions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function is annotated as returning bool, but it currently return numpy.bool_ (which does not seem to inherit from bool): >>> type((np.random.rand(3) > 0.5).all())
<class 'numpy.bool_'>
>>> isinstance((np.random.rand(3) > 0.5).all(), bool)
False |
||
|
||
@property | ||
def inferred_type(self) -> str: | ||
|
Uh oh!
There was an error while loading. Please reload this page.