BUG: DataFrame.merge(suffixes=) does not respect None
State: closed

- [ ] closes #24782 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

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







Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on February 04, 2019 at 17:16 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24819?src=pr&el=h1) Report
> Merging [#24819](https://codecov.io/gh/pandas-dev/pandas/pull/24819?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/512830b46e678a1c6bd86cc60f54d74ff75792db?src=pr&el=desc) will **decrease** coverage by `49.47%`.
> The diff coverage is `0%`.

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

```diff
@@             Coverage Diff             @@
##           master   #24819       +/-   ##
===========================================
- Coverage   92.38%    42.9%   -49.48%     
===========================================
  Files         166      166               
  Lines       52379    52385        +6     
===========================================
- Hits        48392    22478    -25914     
- Misses       3987    29907    +25920
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `42.9% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `9.43% <0%> (-84.84%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `0% <0%> (-99.35%)` | :arrow_down: |
| [pandas/core/groupby/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9jYXRlZ29yaWNhbC5weQ==) | `0% <0%> (-95.46%)` | :arrow_down: |
| [pandas/io/sas/sas7bdat.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXM3YmRhdC5weQ==) | `0% <0%> (-91.17%)` | :arrow_down: |
| [pandas/io/sas/sas\_xport.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfeHBvcnQucHk=) | `0% <0%> (-90.15%)` | :arrow_down: |
| ... and [124 more](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree-more) | |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #24819      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52420    52406      -14     
==========================================
- Hits        48423    48409      -14     
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.79% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.87% <0%> (-0.02%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `94.48% <ø> (ø)` | :arrow_up: |
| [pandas/core/internals/managers.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL21hbmFnZXJzLnB5) | `96.06% <100%> (-0.01%)` | :arrow_down: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `98.37% <0%> (-0.04%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.81% <0%> (-0.02%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `99.34% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/accessor.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWNjZXNzb3IucHk=) | `98.79% <0%> (ø)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `94.28% <0%> (ø)` | :arrow_up: |
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `94.17% <0%> (ø)` | :arrow_up: |
| [pandas/core/sparse/scipy\_sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3NjaXB5X3NwYXJzZS5weQ==) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.63% <0%> (ø)` | :arrow_up: |
| ... and [6 more](https://codecov.io/gh/pandas-dev/pandas/pull/24819/diff?src=pr&el=tree-more) | |

------

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

@TomAugspurger @jorisvandenbossche 
> does this not break if suffixes=None is passed?

i guess that since duplicate labels are allowed in an index then `suffixes=None` should be a valid option. future PR though.
@jreback @TomAugspurger @jschendel @simonjayhawkins I just moved whatsnew from 0.24.0 to 0.24.1 because the new version of Pandas had been released. Please take a look at this PR to see what else I should change. Thanks!
@charlesdong1991 this would be for 0.25.0 anyhow, pls merge master
After discussing with @jorisvandenbossche , and as he suggested, this PR will only solve the case when at most one element is `None`, like `(None, str)` or `(str, None)` will remain column as-is when suffix is None. And for cases like `(None, None)` or `None` or `False`, `(False, False)`, I will open a follow-up issue and PR to discuss and fix.
To be clear, the reason to leave out the `(None, None)` for now is that it already does something else: it does the same as `(False, False)` (raising an error if there will be duplicates). This is not documented or tested, so we could maybe just change it (or otherwise first deprecate it), but let's leave that for the follow-up issue for discussion.
I just did another change based on what we discussed before i left the sprint @jorisvandenbossche , and @toobaz please also take a look to see if we could merge and close this, and then, I will open another issue and PR addressing the potential issue and change for suffixes.
``suffixes=None`` is still invalid right (e.g. passing an actual None value)? this has a test?
thanks @jreback for your review... all changed based on review, pls let me know if you have other questions. 
thanks @charlesdong1991 
@charlesdong1991 do you want open a new issue for changing the `(None, None)` case and allowing `None` and `False` ?
@jorisvandenbossche yes! I will open a new issue addressing `None` related case later today or tomorrow!!
@charlesdong1991 : the Panel.join tests have now been removed, xref #25191. so there should no longer be issues with the code shared between Panel.join and DataFrame.merge with regard to the suffixes=(False, False) behaviour that was causing us problems at europandas.
@simonjayhawkins thanks a lot!! I also noticed it when merging my branch to master!! 

@jorisvandenbossche sorry that recently i was quite busy so didn't have time to work on new PR, i just created a new PR to address None/False behaviour.