@@ -219,11 +219,6 @@ def get_reindexed_values(self, empty_dtype, upcasted_na):
219
219
220
220
else :
221
221
for ax , indexer in self .indexers .items ():
222
- # GH-25014: get_upcasted_na returns iNaT, but
223
- # DatetimeArray.take expects NaT.
224
- # TODO: update get_empty_dtype_and_na to use EAs earlier?
225
- if is_datetime64tz_dtype (values ) and fill_value == tslibs .iNaT :
226
- fill_value = tslibs .NaT
227
222
values = algos .take_nd (values , indexer , axis = ax ,
228
223
fill_value = fill_value )
229
224
@@ -340,8 +335,10 @@ def get_empty_dtype_and_na(join_units):
340
335
elif 'category' in upcast_classes :
341
336
return np .dtype (np .object_ ), np .nan
342
337
elif 'datetimetz' in upcast_classes :
338
+ # GH-25014. We use NaT instead of iNaT, since this eventually
339
+ # ends up in DatetimeArray.take, which does not allow iNaT.
343
340
dtype = upcast_classes ['datetimetz' ]
344
- return dtype [0 ], tslibs .iNaT
341
+ return dtype [0 ], tslibs .NaT
345
342
elif 'datetime' in upcast_classes :
346
343
return np .dtype ('M8[ns]' ), tslibs .iNaT
347
344
elif 'timedelta' in upcast_classes :
0 commit comments