8000 BUG: Fixed merging on tz-aware by TomAugspurger · Pull Request #25033 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fixed merging on tz-aware #25033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix earlier
  • Loading branch information
TomAugspurger committed Jan 30, 2019
commit 8bd020f11e88e1e959bfcbee5233ef354b2ec274
9 changes: 3 additions & 6 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ def get_reindexed_values(self, empty_dtype, upcasted_na):

else:
for ax, indexer in self.indexers.items():
# GH-25014: get_upcasted_na returns iNaT, but
# DatetimeArray.take expects NaT.
# TODO: update get_empty_dtype_and_na to use EAs earlier?
if is_datetime64tz_dtype(values) and fill_value == tslibs.iNaT:
fill_value = tslibs.NaT
values = algos.take_nd(values, indexer, axis=ax,
fill_value=fill_value)

Expand Down Expand Up @@ -340,8 +335,10 @@ def get_empty_dtype_and_na(join_units):
elif 'category' in upcast_classes:
return np.dtype(np.object_), np.nan
elif 'datetimetz' in upcast_classes:
# GH-25014. We use NaT instead of iNaT, since this eventually
# ends up in DatetimeArray.take, which does not allow iNaT.
dtype = upcast_classes['datetimetz']
return dtype[0], tslibs.iNaT
return dtype[0], tslibs.NaT
elif 'datetime' in upcast_classes:
return np.dtype('M8[ns]'), tslibs.iNaT
elif 'timedelta' in upcast_classes:
Expand Down
0