-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix TypeError caused by GH13374 #17465
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 7 commits
edb9337
8d9ac4b
ced6fc6
4b3d5de
4745d6d
6896727
5a9ee56
e9e5e97
a24b96f
f151405
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 |
---|---|---|
|
@@ -218,6 +218,25 @@ def test_multi_char_sep_quotes(self): | |
self.read_csv(StringIO(data), sep=',,', | ||
quoting=csv.QUOTE_NONE) | ||
|
||
def test_none_delimiter(self): | ||
# see gh-13374 and gh-17465 | ||
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. can you add a 1-line comment about what is happening here. Is this only in the python parser as well? 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. Only the Python parser. I actually discovered the issue because I was using the built in CSV sniffer and the C parser for a while, but switched to the python engine with the pandas sniffer because it did notably better for the data files I was using. |
||
|
||
data = "a,b,c\n0,1,2\n3,4,5,6\n7,8,9" | ||
expected = DataFrame({'a': [0, 7], | ||
'b': [1, 8], | ||
'c': [2, 9]}) | ||
|
||
# We expect the third line in the data to be | ||
# skipped because it is malformed | ||
# but we do not expect any errors to occur | ||
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. Nits: add a comma after "malformed" + add a period at end of comment. |
||
result = self.read_csv(StringIO(data), header=0, | ||
sep=None, | ||
error_bad_lines=False, | ||
warn_bad_lines=True, | ||
engine='python', | ||
tupleize_cols=True) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_skipfooter_bad_row(self): | ||
# see gh-13879 | ||
# see gh-15910 | ||
|
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.
Generally practice for is to use parentheses around the conditionals and not to use the slash for something a little nicer to read i.e.: