Wrap raw HTML in StringIO for pd.read_html (#726)#742
Closed
SaguaroDev wants to merge 1 commit intocasact:mainfrom
Closed
Wrap raw HTML in StringIO for pd.read_html (#726)#742SaguaroDev wants to merge 1 commit intocasact:mainfrom
SaguaroDev wants to merge 1 commit intocasact:mainfrom
Conversation
pandas 3.0 removes support for passing literal HTML strings to pd.read_html(); they must be wrapped in io.StringIO. The test_repr test in chainladder/core/tests/test_triangle.py was the only place in the codebase passing raw HTML, and currently emits a FutureWarning on pandas 2.x. Closes casact#726
Collaborator
|
Hi @SaguaroDev, this edit was already made in #729, which handles #664 along with its sub-issues. You're welcome to try solving any unassigned issues outside of #664 and its sub-issues, though. |
Author
Collaborator
|
Thanks @SaguaroDev, and excellent attempt on your first PR! Welcome to the group! We look forward to your contributions!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #726.
Summary
pd.read_html()on pandas 3.0 no longer accepts literal HTML strings; they must be wrapped inio.StringIO. On pandas 2.x this currently emits:A repo-wide search confirmed
chainladder/core/tests/test_triangle.py::test_repris the only call site passing raw HTML, so the fix is a single-line change.iowas already imported in the file.Verification
Reference