Skip to content

Commit a117de4

Browse files
committed
some cleanups
1 parent 4f1ee37 commit a117de4

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

pandas/core/dtypes/base.py

-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ class _DtypeOpsMixin(object):
2626
na_value = np.nan
2727
_metadata = ()
2828

29-
@property
30-
def _ndarray_na_value(self):
31-
"""Private method internal to pandas"""
32-
raise AbstractMethodError(self)
33-
3429
def __eq__(self, other):
3530
"""Check whether 'other' is equal to self.
3631

pandas/core/dtypes/cast.py

-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def changeit():
251251

252252
def maybe_promote(dtype, fill_value=np.nan):
253253
# if we passed an array here, determine the fill value by dtype
254-
255254
if isinstance(fill_value, np.ndarray):
256255
if issubclass(fill_value.dtype.type, (np.datetime64, np.timedelta64)):
257256
fill_value = iNaT

pandas/core/generic.py

-1
Original file line numberDiff line numberDiff line change
@@ -9661,7 +9661,6 @@ def describe_categorical_1d(data):
96619661

96629662
if is_datetime64_any_dtype(data):
96639663
tz = data.dt.tz
9664-
# astype for ndarray / datetimearray compat.
96659664
asint = data.dropna().values.view('i8')
96669665
top = Timestamp(top)
96679666
if top.tzinfo is not None and tz is not None:

pandas/core/indexes/datetimelike.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def equals(self, other):
101101

102102
@staticmethod
103103
def _join_i8_wrapper(joinf, dtype, with_indexers=True):
104-
"""Create the join wrapper methods."""
104+
"""
105+
Create the join wrapper methods.
106+
"""
105107
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
106108

107109
@staticmethod
@@ -195,7 +197,7 @@ def sort_values(self, return_indexer=False, ascending=True):
195197
else:
196198
sorted_values = np.sort(self._ndarray_values)
197199
attribs = self._get_attributes_dict()
198-
freq = self.freq
200+
freq = attribs['freq']
199201

200202
if freq is not None and not is_period_dtype(self):
201203
if freq.n > 0 and not ascending:
@@ -637,12 +639,6 @@ def _time_shift(self, periods, freq=None):
637639
result.name = self.name
638640
return result
639641

640-
# -
641-
# dispatch
642-
643-
def _has_same_tz(self, other):
644-
return self._data._has_same_tz(other)
645-
646642
@classmethod
647643
def _create_comparison_method(cls, op):
648644
"""
@@ -702,6 +698,7 @@ def index_method(self, *args, **kwargs):
702698
if pin_name:
703699
result.name = self.name
704700
return result
701+
return result
705702

706703
index_method.__name__ = method.__name__
707704
index_method.__doc__ = method.__doc__

pandas/core/indexes/datetimes.py

+1
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,7 @@ def slice_indexer(self, start=None, end=None, step=None, kind=None):
12571257
False)
12581258
month_name = wrap_array_method(DatetimeArray.month_name, True)
12591259
day_name = wrap_array_method(DatetimeArray.day_name, True)
1260+
_has_same_tz = wrap_array_method(DatetimeArray._has_same_tz, box=False)
12601261

12611262
# --------------------------------------------------------------------
12621263

0 commit comments

Comments
 (0)