BUG: Check that values for "nrows" and "chunksize" are valid
State: closed

 - [x] closes #15767
 - [x] tests added / passed
 - [x] passes ``git diff master --name-only -- '*.py' | flake8 --diff``
 - [x] whatsnew entry

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO CSV
description: read_csv, to_csv

Comments:
Looks good!

Currently, `chunksize=0` also 'works' (it was only negatives and floats between 0 and 1 that caused the infinite loop, chunksize=0 is somehow checked for), but just directly returning the full dataframe. I suppose because the 0 was just interpreted as 'False'. 
I don't think we need to keep supporting this, however, as this is rather strange?

lgtm. ~~I agree with @jorisvandenbossche point, that ``chunksize==0`` should be an error as well.~~

I c you did that.

ok ping on green.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15774?src=pr&el=h1) Report
> Merging [#15774](https://codecov.io/gh/pandas-dev/pandas/pull/15774?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.


```diff
@@            Coverage Diff             @@
##           master   #15774      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.02%     
==========================================
  Files         143      143              
  Lines       49384    49384              
==========================================
- Hits        44947    44939       -8     
- Misses       4437     4445       +8
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15774?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/parsers.py](https://codecov.io/gh/pandas-dev/pandas/compare/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c...b21fdcf1dfe778563b71f1af547410edaad97ca6?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhcnNlcnMucHk=) | `95.51% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/compare/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c...b21fdcf1dfe778563b71f1af547410edaad97ca6?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/compare/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c...b21fdcf1dfe778563b71f1af547410edaad97ca6?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.86% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c...b21fdcf1dfe778563b71f1af547410edaad97ca6?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.3% <0%> (+0.33%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15774?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/15774?src=pr&el=footer). Last update [1c9d46a...b21fdcf](https://codecov.io/gh/pandas-dev/pandas/compare/1c9d46a3bb8737c877b0a15aaea15dfb0172ac1c...b21fdcf1dfe778563b71f1af547410edaad97ca6?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
@toobaz Thanks!
You're welcome!