BUG: wide_to_long should check for unique id vars (#16382)
State: closed

 - [x] closes #16382 
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``

Input validation: raise a ValueError in case `i` does not uniquely identify each row.


Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Regression
description: Functionality that used to work in a prior pandas version

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

```diff
@@            Coverage Diff             @@
##           master   #16403      +/-   ##
==========================================
+ Coverage   90.41%   90.41%   +<.01%     
==========================================
  Files         161      161              
  Lines       50997    50999       +2     
==========================================
+ Hits        46107    46109       +2     
  Misses       4890     4890
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.24% <100%> (ø)` | :arrow_up: |
| #single | `40.19% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `99.28% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16403?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/16403?src=pr&el=footer). Last update [0f55de1...cc46e98](https://codecov.io/gh/pandas-dev/pandas/pull/16403?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/16403?src=pr&el=h1) Report
> Merging [#16403](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a8a497f0d8c1acd472d57dfb48832292fb3f8c2e?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/16403/graphs/tree.svg?width=650&height=150&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #16403      +/-   ##
==========================================
+ Coverage   90.42%   90.42%   +<.01%     
==========================================
  Files         161      161              
  Lines       51023    51026       +3     
==========================================
+ Hits        46138    46141       +3     
  Misses       4885     4885
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.26% <100%> (ø)` | :arrow_up: |
| #single | `40.17% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/reshape.py](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9yZXNoYXBlLnB5) | `99.28% <100%> (ø)` | :arrow_up: |
| [pandas/io/formats/style.py](https://codecov.io/gh/pandas-dev/pandas/pull/16403?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvc3R5bGUucHk=) | `95.92% <0%> (+0.01%)` | :arrow_up: |

------

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

pls add a whatsnew note (bug fix 0.20.2)
thanks @nuffe !