dispatch Series[datetime64] comparison ops to DatetimeIndex
State: closed

When we tried this a few weeks ago (#19524) there were idiosyncratic CI errors.  Hopefully the smaller scope here will avoid that problem.

If this works, we'll be very nearly ready to move these ops to the Block level and ensure consistency with DataFrame in addition to Index/Series.

Labels:
name: Refactor
description: Internal refactoring of code
name: Datetime
description: Datetime data dtype
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19800?src=pr&el=h1) Report
> Merging [#19800](https://codecov.io/gh/pandas-dev/pandas/pull/19800?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/52559f535788b3c59c6c78d2cf987b03303b16f6?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `84.61%`.

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

```diff
@@            Coverage Diff             @@
##           master   #19800      +/-   ##
==========================================
+ Coverage   91.66%   91.66%   +<.01%     
==========================================
  Files         150      150              
  Lines       49027    49026       -1     
==========================================
  Hits        44940    44940              
+ Misses       4087     4086       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.04% <84.61%> (ø)` | :arrow_up: |
| #single | `41.83% <76.92%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19800?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/19800/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.59% <100%> (+0.08%)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/19800/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `96.33% <83.33%> (-0.61%)` | :arrow_down: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/19800/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.66% <0%> (+0.21%)` | :arrow_up: |

------

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

> Can you reference the old PR, and is this closing an issue?

Just added reference to #19524 in OP.  And no, no issue unless you count #18824 ongoing effort to make Series/Index (and soon DataFrame) arith/comparison ops consistent.
> can you add a separate test for date (I know its wrong, but assert that it is wrong)

Sure.  Gonna wait to see if next appveyor build finally works first.
Booyah!  No power in the verse can stop me.
> this it a bug then, something is assuming int64 but getting int32, if you want to attach the last:

Not sure what "attach the last" means here.

This appears to work as-is, but is pretty ugly.  I'm going to take a shot at cleaning up 140-154 in indexes.datetimes, punt on the side-issue of why a Series[int32] is getting passed.  We can try to make DTI comparisons (and tests) more robust when addressing #19804.
Trouble has been shot. This should be ready for review.
Travis error is on pyarrow import
This should now be OK.
thanks!