removed not necessary bn switch decorator on nansum
State: closed

Removed not necessary bottleneck_switch decorator on nansum function like nanprod.

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20481?src=pr&el=h1) Report
> Merging [#20481](https://codecov.io/gh/pandas-dev/pandas/pull/20481?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4fb963b6a3261940de5891323a8d217087a2a9a1?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #20481      +/-   ##
==========================================
- Coverage   91.85%   91.84%   -0.01%     
==========================================
  Files         152      152              
  Lines       49231    49230       -1     
==========================================
- Hits        45220    45215       -5     
- Misses       4011     4015       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.23% <ø> (-0.01%)` | :arrow_down: |
| #single | `41.83% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20481?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/nanops.py](https://codecov.io/gh/pandas-dev/pandas/pull/20481/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvbmFub3BzLnB5) | `96.3% <ø> (-0.4%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/20481/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `84.52% <0%> (-0.21%)` | :arrow_down: |

------

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

should also be on ``nansum``. how did you come to change this? e.g. what broke?
oh, now I don't see it so clearly and I'm probably wrong. Nothing has been broken, I was checking the code and I noticed that `bottleneck_switch` seems to do nothing when the function is `nansum` or `nanprod` according to `_bn_ok_dtype`, I thought it would be an unnecessary call.
@mmngreco no it IS unecessary since 0.22 (as we compute sum/prod inside pandas only). was just wondering how you detected it.

happy to have you remove the one on nansum as well. I don't think there is a test for this that would break, but if you have something would be great.
I have not found any test for `bottleneck_switch`, I understand that this would be necessary for this case. I haven't written anything yet. I will try in the next few days as I am not sure how to do it.
Thanks @mmngreco