-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Follow-ups to #24024 #24573
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
CLN: Follow-ups to #24024 #24573
Changes from 2 commits
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 |
---|---|---|
|
@@ -3082,7 +3082,7 @@ def _box_item_values(self, key, values): | |
def _maybe_cache_changed(self, item, value): | ||
"""The object has called back to us saying maybe it has changed. | ||
""" | ||
self._data.set(item, value, check=False) | ||
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. check is never True, removed the corresponding code in internals.managers and internals.blocks |
||
self._data.set(item, value) | ||
|
||
@property | ||
def _is_cached(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,23 +31,24 @@ | |
_index_doc_kwargs = dict(ibase._index_doc_kwargs) | ||
|
||
|
||
def ea_passthrough(name): | ||
def ea_passthrough(array_method): | ||
""" | ||
Make an alias for a method of the underlying ExtensionArray. | ||
|
||
Parameters | ||
---------- | ||
name : str | ||
array_method : method on an Array class | ||
|
||
Returns | ||
------- | ||
method | ||
""" | ||
|
||
def method(self, *args, **kwargs): | ||
return getattr(self._eadata, name)(*args, **kwargs) | ||
return array_method(self._data, *args, **kwargs) | ||
|
||
method.__name__ = name | ||
# TODO: docstrings | ||
method.__name__ = array_method.__name__ | ||
method.__doc__ = array_method.__doc__ | ||
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. this should address @jorisvandenbossche's point that docstrings are lost in the existing implementation |
||
return method | ||
|
||
|
||
|
@@ -67,9 +68,10 @@ class DatetimeIndexOpsMixin(ExtensionOpsMixin): | |
_resolution = cache_readonly(DatetimeLikeArrayMixin._resolution.fget) | ||
resolution = cache_readonly(DatetimeLikeArrayMixin.resolution.fget) | ||
|
||
_box_values = ea_passthrough("_box_values") | ||
_maybe_mask_results = ea_passthrough("_maybe_mask_results") | ||
__iter__ = ea_passthrough("__iter__") | ||
_box_values = ea_passthrough(DatetimeLikeArrayMixin._box_values) | ||
_maybe_mask_results = ea_passthrough( | ||
DatetimeLikeArrayMixin._maybe_mask_results) | ||
__iter__ = ea_passthrough(DatetimeLikeArrayMixin.__iter__) | ||
|
||
@property | ||
def _eadata(self): | ||
|
@@ -275,9 +277,6 @@ def sort_values(self, return_indexer=False, ascending=True): | |
if not ascending: | ||
sorted_values = sorted_values[::-1] | ||
|
||
sorted_values = self._maybe_box_as_values(sorted_values, | ||
**attribs) | ||
|
||
return self._simple_new(sorted_values, **attribs) | ||
|
||
@Appender(_index_shared_docs['take'] % _index_doc_kwargs) | ||
|
@@ -613,14 +612,6 @@ def _concat_same_dtype(self, to_concat, name): | |
new_data = type(self._values)._concat_same_type(to_concat).asi8 | ||
return self._simple_new(new_data, **attribs) | ||
|
||
def _maybe_box_as_values(self, values, **attribs): | ||
# TODO(DatetimeArray): remove | ||
# This is a temporary shim while PeriodArray is an ExtensoinArray, | ||
# but others are not. When everyone is an ExtensionArray, this can | ||
# be removed. Currently used in | ||
# - sort_values | ||
return values | ||
|
||
@Appender(_index_shared_docs['astype']) | ||
def astype(self, dtype, copy=True): | ||
if is_dtype_equal(self.dtype, dtype) and copy is False: | ||
|
Uh oh!
There was an error while loading. Please reload this page.