Fix first_valid_index/last_valid_index on DataFrame of all None/NaN values
State: closed

Ensures DataFrame behaves consistent to Series when calling first_valid_index or last_valid_index when all values in df are None/NaN.

- [x] closes #17400
- [x] added two test cases in pandas/tests/frame/test_timeseries.py (all other tests of first/last_valid_index() were located there) and verified that they failed prior to/passed after the change.
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:

Comments:
#17488 already has this covered. thanks for the effort. lots of issues out there; welcome other PRs!
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17646?src=pr&el=h1) Report
> Merging [#17646](https://codecov.io/gh/pandas-dev/pandas/pull/17646?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e2757a2db0faa7878858b36f602235daa936a674?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `85.71%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17646      +/-   ##
==========================================
- Coverage   91.22%    91.2%   -0.03%     
==========================================
  Files         163      163              
  Lines       49655    49667      +12     
==========================================
+ Hits        45296    45297       +1     
- Misses       4359     4370      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.99% <85.71%> (-0.01%)` | :arrow_down: |
| #single | `40.16% <0%> (-0.08%)` | :arrow_down: |

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

------

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

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17646?src=pr&el=h1) Report
> Merging [#17646](https://codecov.io/gh/pandas-dev/pandas/pull/17646?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e2757a2db0faa7878858b36f602235daa936a674?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `85.71%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17646      +/-   ##
==========================================
- Coverage   91.22%    91.2%   -0.03%     
==========================================
  Files         163      163              
  Lines       49655    49667      +12     
==========================================
+ Hits        45296    45297       +1     
- Misses       4359     4370      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.99% <85.71%> (-0.01%)` | :arrow_down: |
| #single | `40.16% <0%> (-0.08%)` | :arrow_down: |

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

------

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