-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
FIX # 45957 issue read_csv with empty list #46033
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
Conversation
Hello @profMsaif! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
I think elif engine != "python":
raise TypeError("Lists are only supported with engine='python'.") Probably need to phrase it differently: I don't think we want to encourage people calling |
This message will be not informative for the pandas user, |
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.
I am pretty sure, that a list is valid here. I think we get a list when calling the Parsers through read_excel.
Please always add tests
Edit: Yep confirmed, read_excel passes through here with a list
Then how about raising exactly the same error as in previous versions? elif engine != "python":
# read_excel uses the python engine with a list
raise ValueError(f"Invalid file path or buffer object type: {type(f)}") Please don't forget to also add a test case. edit: Or could have something like this if isinstance(filepath_or_buffer, list):
ValueError(f"Invalid file path or buffer object type: {type(f)}") around here pandas/pandas/io/parsers/readers.py Line 542 in 971752a
|
closing as fixed by #46325. Thanks @profMsaif for the PR. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.