Skip to content

Commit 8bd020f

Browse files
committed
fix earlier
1 parent 58f2892 commit 8bd020f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/core/internals/concat.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,6 @@ def get_reindexed_values(self, empty_dtype, upcasted_na):
219219

220220
else:
221221
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
227222
values = algos.take_nd(values, indexer, axis=ax,
228223
fill_value=fill_value)
229224

@@ -340,8 +335,10 @@ def get_empty_dtype_and_na(join_units):
340335
elif 'category' in upcast_classes:
341336
return np.dtype(np.object_), np.nan
342337
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.
343340
dtype = upcast_classes['datetimetz']
344-
return dtype[0], tslibs.iNaT
341+
return dtype[0], tslibs.NaT
345342
elif 'datetime' in upcast_classes:
346343
return np.dtype('M8[ns]'), tslibs.iNaT
347344
elif 'timedelta' in upcast_classes:

0 commit comments

Comments
 (0)