Support non unique period indexes on join and merge operations
State: closed

 - [x] closes #16871
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
 - [x] whatsnew entry

Now join and merge operations on dataframes with non unique period indexes are supported, test included.

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

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

 - In the file [`pandas/core/indexes/base.py`](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py), following are the PEP8 issues :

> [Line 58:1](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py#L58): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 1022:13](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py#L1022): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 1978:9](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py#L1978): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'
> [Line 2257:9](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py#L2257): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'
> [Line 2920:13](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/core/indexes/base.py#L2920): [E741](https://duckduckgo.com/?q=pep8%20E741) ambiguous variable name 'l'



 - In the file [`pandas/tests/reshape/test_merge.py`](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/tests/reshape/test_merge.py), following are the PEP8 issues :

> [Line 919:13](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/tests/reshape/test_merge.py#L919): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def
> [Line 920:13](https://github.com/pandas-dev/pandas/blob/1560d75f769a296db090a9e25a3c9224b65f8b9f/pandas/tests/reshape/test_merge.py#L920): [E731](https://duckduckgo.com/?q=pep8%20E731) do not assign a lambda expression, use a def



##### Comment last updated on July 15, 2017 at 18:16 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16949?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@daf07a6`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #16949   +/-   ##
=========================================
  Coverage          ?   90.96%           
=========================================
  Files             ?      161           
  Lines             ?    49288           
  Branches          ?        0           
=========================================
  Hits              ?    44837           
  Misses            ?     4451           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.74% <100%> (?)` | |
| #single | `40.2% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16949?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/16949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.8% <100%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16949?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/16949?src=pr&el=footer). Last update [daf07a6...40b964a](https://codecov.io/gh/pandas-dev/pandas/pull/16949?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/16949?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@daf07a6`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #16949   +/-   ##
=========================================
  Coverage          ?   90.96%           
=========================================
  Files             ?      161           
  Lines             ?    49288           
  Branches          ?        0           
=========================================
  Hits              ?    44837           
  Misses            ?     4451           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.74% <100%> (?)` | |
| #single | `40.2% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16949?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/16949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.8% <100%> (ø)` | |

------

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