Skip to content

Commit 4f1ee37

Browse files
committed
revert constructor change
1 parent e7538e6 commit 4f1ee37

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

pandas/core/arrays/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ def where(self, cond, other):
612612
self._check_compatible_with(other)
613613
other = other.asi8
614614
result = np.where(cond, i8, other)
615-
return type(self)._simple_new(result, dtype=self.dtype)
615+
return type(self)(result, dtype=self.dtype)
616616

617617
@classmethod
618618
def _concat_same_type(cls, to_concat):

pandas/core/arrays/datetimes.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ class DatetimeArrayMixin(dtl.DatetimeLikeArrayMixin,
205205
_freq = None
206206

207207
@classmethod
208-
def _simple_new(cls, values, freq=None, tz=None, dtype=None):
209-
# TODO: can we make this signature just
210-
# values, dtype, freq?
208+
def _simple_new(cls, values, freq=None, tz=None):
211209
"""
212210
we require the we have a dtype compat for the values
213211
if we are passed a non-dtype compat, then coerce using the constructor
@@ -220,8 +218,6 @@ def _simple_new(cls, values, freq=None, tz=None, dtype=None):
220218
values = values.view('M8[ns]')
221219

222220
assert values.dtype == 'M8[ns]', values.dtype
223-
if tz is None and dtype:
224-
tz = getattr(dtype, 'tz')
225221

226222
result = object.__new__(cls)
227223
result._data = values

0 commit comments

Comments
 (0)