-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: fixes formatted value error for missing sheet (#27676) #27677
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
BUG: fixes formatted value error for missing sheet (#27676) #27677
Conversation
Thanks. Could you release note under "Bug fixes" in |
You can ignore the codecov failure. |
Looks good. Can you check test coverage for this though? Should have one for all excel / odf engines |
Interesting that all of the engines raise differently... @ilogue do you have an idea of effort to align all of these messages? Would ideally like to do here if not too much effort but could also leave to a follow up if non-trivial |
@WillAyd by align do you mean catch the exceptions thrown by the other packages and rethrow a common pandas exception? Or ask the maintainers of those packages to change their error message? |
Yea I mean raise one common error message from |
doc/source/whatsnew/v0.25.1.rst
Outdated
@@ -25,6 +25,7 @@ Other enhancements | |||
Bug fixes | |||
~~~~~~~~~ | |||
|
|||
- Bug in :meth:`DataFrame.read_excel` with `engine='ods'` when `sheet_name` argument references a non-existent sheet (:issue:`27676`) |
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.
can you move this to the IO section, double backticks rather than single around engine='ods'
and sheet_name
…der-sheetname-missing
@ilogue looks like the CI is failing. Do these tests pass for you locally? |
No they don't work, because they currently target all engines. So we could
|
Sorry didn't mean to close, on my phone |
Do you have an opinion on which option is better? |
pandas/tests/io/excel/test_odf.py
Outdated
@@ -36,3 +36,11 @@ def test_read_writer_table(): | |||
result = pd.read_excel("writertable.odt", "Table1", index_col=0) | |||
|
|||
tm.assert_frame_equal(result, expected) | |||
|
|||
|
|||
def test_nonexistent_sheetname_raises(self, read_ext): |
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.
The use of self
here is causing the error. This isn't a class method so that's what is failing CI.
If you remove I think should turn green
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.
should be done in c45ffb3
This reverts commit 9306864. Duplicates pandas-dev#27677
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.
On phone so can’t check but looks like there is an outstanding CI failure that needs to be addressed. Otherwise lgtm
doc/source/whatsnew/v0.25.2.rst
Outdated
@@ -64,7 +64,7 @@ I/O | |||
|
|||
- Fix regression in notebook display where <th> tags not used for :attr:`DataFrame.index` (:issue:`28204`). | |||
- Regression in :meth:`~DataFrame.to_csv` where writing a :class:`Series` or :class:`DataFrame` indexed by an :class:`IntervalIndex` would incorrectly raise a ``TypeError`` (:issue:`28210`) | |||
- | |||
- Bug in :meth:`DataFrame.read_excel` with ``engine='ods'`` when ``sheet_name`` argument references a non-existent sheet (:issue:`27676`) |
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.
Can you move this to 1.0.0?
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.
done
@ilogue can you fix up merge conflicts and revert any changes to 0.25.2 whatsnew? |
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.
doc comment, ping on green.
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -398,6 +399,12 @@ Sparse | |||
- | |||
- | |||
|
|||
|
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.
not sure what this is, pls remove
Great thanks @ilogue |
Fixes a formatted message at io.excel._odfreader line 62
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff