Merge asof with nans
State: closed

Fix to raise a more meaningful error message when attempting to merge_asof with missing values

- [ ] closes #23189 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Error Reporting
description: Incorrect or improved errors from pandas

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

 - In the file [`pandas/core/reshape/merge.py`](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/core/reshape/merge.py), following                are the PEP8 issues :
> [Line 816:9](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/core/reshape/merge.py#L816): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 817:9](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/core/reshape/merge.py#L817): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 1470:9](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/core/reshape/merge.py#L1470): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 1617:5](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/core/reshape/merge.py#L1617): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def


 - In the file [`pandas/tests/reshape/merge/test_merge_asof.py`](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/tests/reshape/merge/test_merge_asof.py), following                are the PEP8 issues :
> [Line 439:9](https://github.com/svenharris/pandas/blob/e954263fc7c9203e1e053bf3e00d11336e35c45f/pandas/tests/reshape/merge/test_merge_asof.py#L439): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def




##### Comment last updated on October 16, 2018 at 20:11 Hours UTC
Not sure why the pep8 speaks is flagging lines that weren't updated in this PR, I think I may have messed up the git history somewhere
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23190?src=pr&el=h1) Report
> Merging [#23190](https://codecov.io/gh/pandas-dev/pandas/pull/23190?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/913f71f74709e4d4814e50f21768b97ce2c6ef8d?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/23190/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23190?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #23190      +/-   ##
==========================================
+ Coverage   92.19%   92.19%   +<.01%     
==========================================
  Files         169      169              
  Lines       50959    50964       +5     
==========================================
+ Hits        46980    46985       +5     
  Misses       3979     3979
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <100%> (ø)` | :arrow_up: |
| #single | `42.29% <11.11%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23190?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/23190/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `93.94% <100%> (+0.04%)` | :arrow_up: |

------

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

@svenharris very nice. can you merge master. ping on green. the CI was giving some trouble before.
actually this is fine, the CI failure is not yet fixed (but unrelated to this PR)
keep em coming!