Read csv category fix
State: closed

- [x] closes #18186
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whats new entry

Summary:

- Fix the bug as suggested by @TomAugspurger in issue #18186 
- Added a unit test which ensures fix is working.


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

Comments:
A few comments, but looks good.  Thanks!
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18402?src=pr&el=h1) Report
> Merging [#18402](https://codecov.io/gh/pandas-dev/pandas/pull/18402?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/509e03c6b113e78935ae46707572e4bf7f7a1df5?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18402      +/-   ##
==========================================
- Coverage   91.36%   91.34%   -0.02%     
==========================================
  Files         164      164              
  Lines       49730    49730              
==========================================
- Hits        45435    45426       -9     
- Misses       4295     4304       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.14% <ø> (ø)` | :arrow_up: |
| #single | `39.62% <ø> (-0.07%)` | :arrow_down: |

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

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18402?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/18402?src=pr&el=footer). Last update [509e03c...b831699](https://codecov.io/gh/pandas-dev/pandas/pull/18402?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/18402?src=pr&el=h1) Report
> Merging [#18402](https://codecov.io/gh/pandas-dev/pandas/pull/18402?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/103ea6fa33cbee3d9a193010016faa4cec7abf87?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18402      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         163      163              
  Lines       49714    49714              
==========================================
- Hits        45415    45406       -9     
- Misses       4299     4308       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.13% <ø> (ø)` | :arrow_up: |
| #single | `39.63% <ø> (-0.07%)` | :arrow_down: |

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

------

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

@jschendel PTAL. I made the changes you requested but I think there is still something off...
@jreback PTAL.
@jreback requested changes are completed. PTAL.
pls rebase
thanks!