-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Python Parser skipping over items if BOM present in first element of header #36365
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 2 commits
77b9cdc
3ab5760
a38538b
66bccdd
72c9b2c
891e8d4
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 |
---|---|---|
|
@@ -2127,6 +2127,12 @@ def test_first_row_bom(all_parsers): | |
expected = DataFrame(columns=["Head1", "Head2", "Head3"]) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
# see gh-36343 | ||
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 make this a new test 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. done, I think test failures are unrelated. https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=42772&view=ms.vss-test-web.build-test-results-tab&runId=2173848&resultId=150762&paneView=debug |
||
data = """\ufeffHead1 Head2 Head3""" | ||
|
||
result = parser.read_csv(StringIO(data), delimiter="\t") | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
def test_integer_precision(all_parsers): | ||
# Gh 7072 | ||
|
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.
Hmm I don't find this very clear why we would do this - can you try refactoring the code above this to better suit the requirement?
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.
from what I understand
the code block above removes the BOM from the first element of the row and removes the quotes if it was a quoted string. i.e. if it was of the format
<BOM><QUOTE>abc<QUOTE>def
then it extracts outabcdef
I've tried to refactor it slightly