BUG: Parse two date columns broken in read_csv with multiple headers
State: closed

Fix for GH15376

In `io/parsers/_try_convert_dates()` when selecting columns based on a
column index from a set of columns with multi-level names, the column
`name` was converted to a string.  This appears to be a bug since the
`name` was a tuple before the conversion.  This causes problems
downstream when there is an attempt to use this name to lookup a
column, and that lookup fails because the desired column is keyed from
the tuple, not its string representation.

 - [x] closes #15376
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master | flake8 --diff``
 - [x] whatsnew entry


Labels:
name: Bug
name: IO CSV
description: read_csv, to_csv

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15378?src=pr&el=h1) Report
> Merging [#15378](https://codecov.io/gh/pandas-dev/pandas/pull/15378?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5a8883b965610234366150897fe8963abffd6a7c?src=pr&el=desc) will **decrease** coverage by `-0.01%`.
> The diff coverage is `100%`.


```diff
@@            Coverage Diff             @@
##           master   #15378      +/-   ##
==========================================
- Coverage   90.37%   90.37%   -0.01%     
==========================================
  Files         135      135              
  Lines       49440    49454      +14     
==========================================
+ Hits        44681    44693      +12     
- Misses       4759     4761       +2
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15378?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.51% <100%> (ø)` | :white_check_mark: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.02% <ø> (-0.34%)` | :x: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.82% <ø> (-0.05%)` | :x: |
| [pandas/tools/concat.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL2NvbmNhdC5weQ==) | `97.62% <ø> (ø)` | :white_check_mark: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.33% <ø> (ø)` | :white_check_mark: |
| [pandas/io/excel.py](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?src=pr&el=tree#diff-cGFuZGFzL2lvL2V4Y2VsLnB5) | `79.64% <ø> (+0.24%)` | :white_check_mark: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15378?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/15378?src=pr&el=footer). Last update [5a8883b...030f5ec](https://codecov.io/gh/pandas-dev/pandas/compare/5a8883b965610234366150897fe8963abffd6a7c...030f5ec8755fa39c11a07d86a2f211fe113ba789?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
ok ping on green.
can you update
@jreback, You asked for update 4 days back, but I thought this was OK.  If you still need something, please let me know what.
closed via: https://github.com/pandas-dev/pandas/commit/fb7dc7dcbde1d81dea28b1b83e1c3bd171a7e73d

thanks @stephenrauch 

this test was in the wrong place (I had made a comment above, but not sure if you saw it).

In fact I think *all* of the pandas/tests/io/test_date_converters are in the wrong place and should simply be in ``pandas/tests/io/parsers/parse_dates.py`` (or equiv), so that they run under each parser. My guess is that this is an older file.

I'll create an issue about this.