Fix DTI comparison with None, datetime.date
State: closed

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


Labels:
name: Datetime
description: Datetime data dtype
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
Looks like Travis cancellation.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19301?src=pr&el=h1) Report
> Merging [#19301](https://codecov.io/gh/pandas-dev/pandas/pull/19301?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/35812eaaecebeeee0ddf07dee4b583c4eea07785?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

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

```diff
@@           Coverage Diff           @@
##           master   #19301   +/-   ##
=======================================
  Coverage   91.67%   91.67%           
=======================================
  Files         148      148           
  Lines       48553    48553           
=======================================
  Hits        44513    44513           
  Misses       4040     4040
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.04% <100%> (ø)` | :arrow_up: |
| #single | `41.71% <16.66%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19301?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/19301/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.23% <100%> (ø)` | :arrow_up: |

------

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

rebase
11 hours and the OSX build hasn't started.  Possible problem with Travis?
see that red X on the status (on the travis page). They give messages.
> the datetime.date part of this needs to move to where we test comparisions with Timestamp, datetime.datetime and np.datetime64

OK, but it'll be a test identical the the one here, just in a different place.
my point is there already are tests for this - need to collocate them
> my point is there already are tests for this - need to collocate them

OK.  There are no such tests in this file; possible in scalar.  My first choice is to not move anything in this PR, but if we have to either move DTI-with-timestamp-comparison test to tests.scalar or timestamp-with-DTI-comparison test to tests.indexes, I'd prefer the latter.
Not seeing it in scalar either.  I guess I'll add some extras here.
Thoughts here?  This is now a blocker for the next steps in core.ops.
this looks good. rebase and ping on green.
ping
thanks!

@jbrockmendel just wanted to say. very much appreciate your changes. As they get more complicated and/or hit edge cases, I am necessarily being more of a stickler on things. don't take it personally (and you are very responsive!)

pandas is quite complicated and enforcing consistency across user AND developer experiences is hard, but very important.