BUG: Concatentation of TZ-aware dataframes (#12396) (#18447)
State: closed

closes #12396 
closes #18447
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Looking for guidance on this issue related to #12396 that I still haven't fixed. 

```
In [6]: df2 = pd.DataFrame([[pd.Timestamp('2015/01/01', tz='UTC')], [pd.Timestamp('2016/01/01', tz='US/Eastern')]])

In [7]: pd.concat([df1, df2]).dtypes
Out[7]: 
0    object
dtype: object

In [8]: pd.concat([df1, df2])
Out[8]: 
                           0
0                        NaN
1                        NaN
0  2015-01-01 00:00:00+00:00
1  2016-01-01 00:00:00-05:00
```

You said 
> This is incorrect; we are coercing to object (correct), but the NaT are getting incorrectly corced to nan here.

What's the best approach for this? Right now, an object block will never have a property that indicates it contains only datelike data. So going forward, should a Block be able to have self.is_datetime/self.is_datetimtz/etc. = True? Or should this be determined when we decide on the fill_value for a concat operation?
can you rebase
@paul-mannino do you have time to update?
ping @paul-mannino if you have time to update.
I'll fix this up if @paul-mannino doesn't have time in next day or 2
I'll pick this up tomorrow evening
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@648ca95`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/19327/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master   #19327   +/-   ##
=========================================
  Coverage          ?   91.77%           
=========================================
  Files             ?      153           
  Lines             ?    49316           
  Branches          ?        0           
=========================================
  Hits              ?    45262           
  Misses            ?     4054           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.17% <100%> (?)` | |
| #single | `41.88% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/19327/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `95.59% <100%> (ø)` | |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/19327/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.63% <100%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=footer). Last update [648ca95...4323f5e](https://codecov.io/gh/pandas-dev/pandas/pull/19327?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Didn't realize how much refactoring there was left to do. It seems like you want this done ASAP. I don't have time to do this right now--would be a week or two at least. Feel free to take it over.  
No worries. I'll have some time to work on it in ~3 hours.
No luck on the internals refactoring yet. I'm getting tripped up in the concat plan merging.
I won't have time to get to this before the RC. Reverted my changes @paul-mannino.
i refactored the tests and found another case, so still WIP.
superseded by #21014