Fix in date conversion param handling
State: closed

Previously this was trying to update any column name that had changed in `self._convert_dates`. If you had a column name that was non-date that was being changed, it would throw an error.

 - [ ] closes #xxxx
 - [ ] tests added / passed
 - [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
 - [ ] whatsnew entry


Labels:
name: IO Stata
description: read_stata, to_stata

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

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

```diff
@@            Coverage Diff             @@
##           master   #16268      +/-   ##
==========================================
- Coverage   90.32%    90.3%   -0.02%     
==========================================
  Files         167      167              
  Lines       50907    50907              
==========================================
- Hits        45982    45973       -9     
- Misses       4925     4934       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.09% <100%> (ø)` | :arrow_up: |
| #single | `40.29% <0%> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16268?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/stata.py](https://codecov.io/gh/pandas-dev/pandas/pull/16268?src=pr&el=tree#diff-cGFuZGFzL2lvL3N0YXRhLnB5) | `93.47% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16268?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16268?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.58% <0%> (-0.1%)` | :arrow_down: |

------

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

@jreback trying to figure out what would be the best test here. Originally what was exposed was that when both converting dates and truncating column names, it would error out because it would try to delete a missing column name from the `_convert_dates` property of `self`.

I'm thinking that the best would be to write a test similar to [this one](https://github.com/pandas-dev/pandas/blob/1f5ecc9a7008ea2a8af6e136a5bd6b410625623d/pandas/tests/io/test_stata.py#L1168) but changing the name of `strs` to `strs__with_an_unnecessarily_long_column_name_exceeding_32_chars`

Ideally, this test would also include a date column with a name like the current `dates` name, but also a date column with a name like `date_column_with_an_unnecessarily_long_column_name_exceeding_32_chars`

is this the right approach here? (as an aside, i'm super confused on how this patch decreases code coverage in frame.py or in gbq.py…)
an example of where you found this would help (iow how did you discover this issue) 

ignore the codecov 
pls add some tests
closing as stale. if you want to re-visit, pls comment and we can re-open.