implement fillna from 24024, with fixes and tests
State: closed

cc @jreback @TomAugspurger 

couple of issues with `fillna` needed sorting out

- The DTA version was operating in-place (fixed+tested)
- The TDA version would raise because it wasn't supported in core.missing (fixed+tested)
- The DTA[tz] version would incorrectly re-localize using the existing constructors, i.e. was dependent on the constructor changes in 24024.  With the edits here it is correct regardless of whether the constructor is changed.


Labels:
name: Refactor
description: Internal refactoring of code
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
kind of weird that `Series[timedelta64].fillna(method='pad')` works OK in master, will need to track down why it hadn't been supported directly in core.missing.pad_1d
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24536?src=pr&el=h1) Report
> Merging [#24536](https://codecov.io/gh/pandas-dev/pandas/pull/24536?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/091cfbb053c8522acd4f851f6a93626751e77dbb?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `12.5%`.

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

```diff
@@            Coverage Diff             @@
##           master   #24536      +/-   ##
==========================================
- Coverage   31.88%   31.87%   -0.01%     
==========================================
  Files         166      166              
  Lines       52427    52438      +11     
==========================================
  Hits        16714    16714              
- Misses      35713    35724      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `30.27% <12.5%> (-0.01%)` | :arrow_down: |
| #single | `31.87% <12.5%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24536?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `41.87% <ø> (+1.26%)` | :arrow_up: |
| [pandas/core/missing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvbWlzc2luZy5weQ==) | `10.25% <0%> (-0.11%)` | :arrow_down: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `37.11% <14.28%> (-1.25%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24536?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/24536?src=pr&el=footer). Last update [091cfbb...aa9f457](https://codecov.io/gh/pandas-dev/pandas/pull/24536?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/24536?src=pr&el=h1) Report
> Merging [#24536](https://codecov.io/gh/pandas-dev/pandas/pull/24536?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/091cfbb053c8522acd4f851f6a93626751e77dbb?src=pr&el=desc) will **increase** coverage by `60.44%`.
> The diff coverage is `100%`.

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

```diff
@@             Coverage Diff             @@
##           master   #24536       +/-   ##
===========================================
+ Coverage   31.88%   92.32%   +60.44%     
===========================================
  Files         166      166               
  Lines       52427    52440       +13     
===========================================
+ Hits        16714    48417    +31703     
+ Misses      35713     4023    -31690
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.75% <100%> (+60.46%)` | :arrow_up: |
| #single | `43% <12.5%> (+11.12%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24536?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `98.52% <ø> (+57.91%)` | :arrow_up: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `96.61% <100%> (+58.24%)` | :arrow_up: |
| [pandas/core/missing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvbWlzc2luZy5weQ==) | `92.3% <100%> (+81.94%)` | :arrow_up: |
| [pandas/util/\_test\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX3Rlc3RfZGVjb3JhdG9ycy5weQ==) | `90.54% <0%> (+4.05%)` | :arrow_up: |
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `57.91% <0%> (+9.65%)` | :arrow_up: |
| [pandas/core/config\_init.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29uZmlnX2luaXQucHk=) | `99.24% <0%> (+9.84%)` | :arrow_up: |
| [pandas/core/reshape/util.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS91dGlsLnB5) | `100% <0%> (+11.53%)` | :arrow_up: |
| [pandas/core/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXBpLnB5) | `100% <0%> (+13.33%)` | :arrow_up: |
| [pandas/compat/numpy/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9udW1weS9fX2luaXRfXy5weQ==) | `92.85% <0%> (+14.28%)` | :arrow_up: |
| [pandas/io/formats/console.py](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvY29uc29sZS5weQ==) | `74.24% <0%> (+16.66%)` | :arrow_up: |
| ... and [128 more](https://codecov.io/gh/pandas-dev/pandas/pull/24536/diff?src=pr&el=tree-more) | |

------

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

gentle ping
thanks