BUG: prevent coercion to datetime64[ns] when a Series is initialized with both tz-naive and tz-aware
State: closed

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


Labels:
name: Bug
name: Datetime
description: Datetime data dtype
name: Timezones
description: Timezone data dtype

Comments:
Hello @tmnhat2001! Thanks for updating the PR.





Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on November 23, 2017 at 02:49 Hours UTC
so where you are fixing is not the correct location, its a bit after the actual error, rather try here:
https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/src/inference.pyx#L459

a mixed datetime64 & datetime64 that is tz-aware are in the same bucket, rather this needs disambiguation, and ultimately should be 'mixed'.

Note we have *no* tests for this routine, so that is the first thing we need. Pls add to 
``pandas/tests/dtypes/test_inference.py``
my bad, should have checked out that routine
np.datetime64 objects don't have timezone info right? I just want to make sure not to leave it out.
no, no.datetime64 don’t support time zone (they print with a local time zone which is extra confusing)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=h1) Report
> Merging [#18361](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fedc503f0d25b04850a931398fc0556d892d69ea?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18361      +/-   ##
==========================================
- Coverage   91.35%   91.34%   -0.02%     
==========================================
  Files         163      163              
  Lines       49691    49691              
==========================================
- Hits        45397    45388       -9     
- Misses       4294     4303       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.14% <ø> (ø)` | :arrow_up: |
| #single | `39.67% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18361?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/18361?src=pr&el=footer). Last update [fedc503...d6f9181](https://codecov.io/gh/pandas-dev/pandas/pull/18361?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@tmnhat2001 nice patch! keep em coming!
thanks