-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Nrows cannot be zero for read_csv. Fixes #21141 #21431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -995,11 +995,18 @@ def test_read_excel_nrows_greater_than_nrows_in_file(self, ext): | |
|
||
def test_read_excel_nrows_non_integer_parameter(self, ext): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be better to parametrize this test for cases like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @WillAyd sure, I will make these changes as soon as we decide if we are keeping this PR :) |
||
# GH 16645 | ||
msg = "'nrows' must be an integer >=0" | ||
msg = "'nrows' must be an integer >=1" | ||
with tm.assert_raises_regex(ValueError, msg): | ||
pd.read_excel(os.path.join(self.dirpath, 'test1' + ext), | ||
nrows='5') | ||
|
||
def test_read_excel_nrows_zero_parameter(self, ext): | ||
# GH 21141 | ||
msg = "'nrows' must be an integer >=1" | ||
with tm.assert_raises_regex(ValueError, msg): | ||
pd.read_excel(os.path.join(self.dirpath, 'test1' + ext), | ||
nrows=0) | ||
|
||
def test_read_excel_squeeze(self, ext): | ||
# GH 12157 | ||
f = os.path.join(self.dirpath, 'test_squeeze' + ext) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reference the issue number in a comment above this line.