Skip to content
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

Raise ParserWarning not ParserError for Pandas > 1.3.5 #30

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

djbower
Copy link
Contributor

@djbower djbower commented Mar 22, 2024

Raise a ParserWarning to avoid the ParserError pandas.errors.ParserError: Defining usecols with out-of-bounds indices is not allowed. when using Pandas>1.3.5. Now a warning is output for the problematic lines (which relate to comments in the JANAF data).

Tested on an example txt file: https://janaf.nist.gov/tables/H-066.txt

Raise a ParserWarning to avoid the ParserError `pandas.errors.ParserError: Defining usecols with out-of-bounds indices is not allowed.` when using Pandas>1.3.5.  Now a warning is output for the problematic lines (which relate to comments in the JANAF data).

Tested on an example txt file: https://janaf.nist.gov/tables/H-066.txt
This is related to pull request adelq#30, which requires at least Pandas 1.3.0 for the `on_bad_lines` keyword argument to be available.

See https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
Copy link
Collaborator

@ZGainsforth ZGainsforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Ideally we should have a patch to fix bad lines if they follow a pattern in the JANAF data, but at least warning is better.

@ZGainsforth ZGainsforth merged commit f40c451 into adelq:master Mar 22, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants