-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Raise error for 'sheet' arg in read_excel #18604
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 @lucianoviola! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on July 07, 2018 at 16:23 Hours UTC |
d257639
to
1e6b21a
Compare
Codecov Report
@@ Coverage Diff @@
## master #18604 +/- ##
==========================================
- Coverage 91.46% 91.45% -0.02%
==========================================
Files 157 157
Lines 51439 51441 +2
==========================================
- Hits 47051 47043 -8
- Misses 4388 4398 +10
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18604 +/- ##
==========================================
- Coverage 91.95% 91.45% -0.51%
==========================================
Files 160 157 -3
Lines 49837 51441 +1604
==========================================
+ Hits 45830 47043 +1213
- Misses 4007 4398 +391
Continue to review full report at Codecov.
|
1e6b21a
to
8c9061b
Compare
pandas/io/excel.py
Outdated
@@ -225,6 +225,9 @@ def read_excel(io, sheet_name=0, header=0, skiprows=None, skip_footer=0, | |||
elif 'sheetname' in kwds: | |||
raise TypeError("Cannot specify both `sheet_name` and `sheetname`. " | |||
"Use just `sheet_name`") | |||
if 'sheet' in kwds: | |||
raise TypeError("read_excel() got an unexpected keyword argument " | |||
"`sheet`") |
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.
This is not generalizable. What happens if I were to pass in an argument called "Sheet" ? Your check wouldn't catch that. You should develop a more general checker that checks for any keywords that don't correspond to ones that we accept.
Potentially. I personally don't feel too against just raising for incorrect arguments that we don't explicitly document. However, let's see what others have to say? @jreback @jorisvandenbossche ? |
the way to do this is to stop passing thru |
That is indeed the way to go, but currently kwds are passed to |
Ok. I'll have a look at TextParser! |
can you rebase and respond to comments. |
I apologize @jreback. I will get back on it. |
this is all fixed up. |
* ENH: Raise error for read_excel possible "sheet" argument in kwargs (pandas-dev#17994)
I was also thinking about the possibility of raising a warning instead, and do something like: