BUG: fix DataFrame+DataFrame op with timedelta64 dtype
State: closed


Needs whatsnew note.


This has the benefit of looking a lot like the SparseDataframe._combine_frame implementation.  With luck we can de-duplicate those at some point.

Likely to be a perf hit for non-td64 dtypes.  One option would be to use dispatch_to_series more selectively, but that gets complicated in a hurry.

I think long-term the perf solution is going to be to dispatch to EA ops instead of Series ops, as discussed briefly in #22614, but that is a ways away.

- [x] closes #22537
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: Timedelta
description: Timedelta data type
name: DataFrame
description: DataFrame data structure

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

 - There are no PEP8 issues in the file [`pandas/core/frame.py`](https://github.com/jbrockmendel/pandas/blob/d6f7fbf261e7528e32721b6707c303bd8d71ef7d/pandas/core/frame.py) !

 - In the file [`pandas/core/ops.py`](https://github.com/jbrockmendel/pandas/blob/d6f7fbf261e7528e32721b6707c303bd8d71ef7d/pandas/core/ops.py), following                are the PEP8 issues :
> [Line 931:13](https://github.com/jbrockmendel/pandas/blob/d6f7fbf261e7528e32721b6707c303bd8d71ef7d/pandas/core/ops.py#L931): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/tests/frame/test_arithmetic.py`](https://github.com/jbrockmendel/pandas/blob/d6f7fbf261e7528e32721b6707c303bd8d71ef7d/pandas/tests/frame/test_arithmetic.py) !



##### Comment last updated on October 02, 2018 at 01:38 Hours UTC
Looks like Series/DataFrame have some different behavior for bool ops... will look into this.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22696?src=pr&el=h1) Report
> Merging [#22696](https://codecov.io/gh/pandas-dev/pandas/pull/22696?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5ce06b5bdb8c44043c6463bf8ce3da758800a189?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #22696      +/-   ##
==========================================
+ Coverage   92.19%   92.19%   +<.01%     
==========================================
  Files         169      169              
  Lines       50833    50844      +11     
==========================================
+ Hits        46863    46874      +11     
  Misses       3970     3970
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.6% <100%> (ø)` | :arrow_up: |
| #single | `42.36% <14.28%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22696?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/22696/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.2% <100%> (ø)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/22696/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `97.41% <100%> (+0.03%)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/22696/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.62% <0%> (-0.13%)` | :arrow_down: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/22696/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.45% <0%> (+0.05%)` | :arrow_up: |

------

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

Just added whatsnew; should be good to go.
thanks @jbrockmendel