@@ -127,15 +127,15 @@ def ints_to_pydatetime(int64_t[:] arr, object tz=None, object freq=None,
127
127
for i in range (n):
128
128
value = arr[i]
129
129
if value == NPY_NAT:
130
- result[i] = NaT
130
+ result[i] = < object > NaT
131
131
else :
132
132
dt64_to_dtstruct(value, & dts)
133
133
result[i] = func_create(value, dts, tz, freq)
134
134
elif is_tzlocal(tz):
135
135
for i in range (n):
136
136
value = arr[i]
137
137
if value == NPY_NAT:
138
- result[i] = NaT
138
+ result[i] = < object > NaT
139
139
else :
140
140
# Python datetime objects do not support nanosecond
141
141
# resolution (yet, PEP 564). Need to compute new value
@@ -152,7 +152,7 @@ def ints_to_pydatetime(int64_t[:] arr, object tz=None, object freq=None,
152
152
for i in range (n):
153
153
value = arr[i]
154
154
if value == NPY_NAT:
155
- result[i] = NaT
155
+ result[i] = < object > NaT
156
156
else :
157
157
# Adjust datetime64 timestamp, recompute datetimestruct
158
158
dt64_to_dtstruct(value + delta, & dts)
@@ -164,7 +164,7 @@ def ints_to_pydatetime(int64_t[:] arr, object tz=None, object freq=None,
164
164
for i in range (n):
165
165
value = arr[i]
166
166
if value == NPY_NAT:
167
- result[i] = NaT
167
+ result[i] = < object > NaT
168
168
else :
169
169
# Adjust datetime64 timestamp, recompute datetimestruct
170
170
pos = trans.searchsorted(value, side = ' right' ) - 1
@@ -175,7 +175,7 @@ def ints_to_pydatetime(int64_t[:] arr, object tz=None, object freq=None,
175
175
for i in range (n):
176
176
value = arr[i]
177
177
if value == NPY_NAT:
178
- result[i] = NaT
178
+ result[i] = < object > NaT
179
179
else :
180
180
# Adjust datetime64 timestamp, recompute datetimestruct
181
181
pos = trans.searchsorted(value, side = ' right' ) - 1
@@ -439,11 +439,11 @@ def array_with_unit_to_datetime(ndarray values, object unit,
439
439
val = values[i]
440
440
441
441
if checknull_with_nat(val):
442
- oresult[i] = NaT
442
+ oresult[i] = < object > NaT
443
443
elif is_integer_object(val) or is_float_object(val):
444
444
445
445
if val != val or val == NPY_NAT:
446
- oresult[i] = NaT
446
+ oresult[i] = < object > NaT
447
447
else :
448
448
try :
449
449
oresult[i] = Timestamp(cast_from_unit(val, unit))
@@ -452,7 +452,7 @@ def array_with_unit_to_datetime(ndarray values, object unit,
452
452
453
453
elif isinstance (val, str ):
454
454
if len (val) == 0 or val in nat_strings:
455
- oresult[i] = NaT
455
+ oresult[i] = < object > NaT
456
456
457
457
else :
458
458
oresult[i] = val
@@ -816,7 +816,7 @@ cdef array_to_datetime_object(ndarray[object] values, str errors,
816
816
check_dts_bounds(& dts)
817
817
except (ValueError , OverflowError ):
818
818
if is_coerce:
819
- oresult[i] = NaT
819
+ oresult[i] = < object > NaT
820
820
continue
821
821
if is_raise:
822
822
raise
0 commit comments