BUG: Fix MultiIndex names handling in pd.concat
State: closed

This is a fix attempt for issue #15787.

The discrepancy between definition and corresponding implementation of so-called non-none names in function _get_consensus_names leads to this bug.

 - [x] closes #15787 
 - [x] tests added / passed
 - [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
 - [x] whatsnew entry


Labels:
name: Bug
name: MultiIndex

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=h1) Report
> Merging [#15955](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f35209e2279154ed7060dd0e17d41da96f9c0186?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/15955/graphs/tree.svg?height=150&width=650&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #15955      +/-   ##
==========================================
- Coverage      91%      91%   -0.01%     
==========================================
  Files         145      145              
  Lines       49576    49581       +5     
==========================================
+ Hits        45118    45121       +3     
- Misses       4458     4460       +2
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/indexes/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL2luZGV4ZXMvYXBpLnB5) | `98.66% <ø> (ø)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.94% <0%> (-0.19%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `95.51% <0%> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.89% <0%> (ø)` | :arrow_up: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.85% <0%> (ø)` | :arrow_up: |
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/15955?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.57% <0%> (+0.04%)` | :arrow_up: |

------

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