Repository navigation
rfctr(html): prepare for new html parser - #3257
Merged
Merged
Conversation
scanny
force-pushed
the
scanny/prep-for-new-html-parser
branch
from
June 20, 2024 05:28
e391d5a to
75c0755
Compare
scanny
force-pushed
the
scanny/prep-for-new-html-parser
branch
from
June 20, 2024 05:31
75c0755 to
c1f87cc
Compare
scanny
force-pushed
the
scanny/prep-for-new-html-parser
branch
from
June 20, 2024 06:07
c1f87cc to
b2b0e0b
Compare
scanny
force-pushed
the
scanny/prep-for-new-html-parser
branch
from
June 20, 2024 18:46
b2b0e0b to
a6707c4
Compare
The new parser is going to make things crowded for a single module. Extract an `html/` sub-package so the various components can have their own modules.
Now that the broad refactoring is done and HTMLDocument is on its way out, move `HtmlPartitionerOptions` to its natural home in `unstructured.partition.html.partition` alongside `partition_html()`.
In preparation for consolidating the partitioning tests with the soon to be legacy HTMLDocument tests, establish clear test categories and organize tests into those categories.
Some of the HTMLDocument tests are useful and relevant as integration tests for `partition_html()`. Others are implementation specific and are replaced by unit tests on the new parser. Salvage those that will be useful after swapping in the new parser and add them to `test_unstructured/partition/html/test_partition.py`. These will be adjusted after installing the new parser to call `partition_html()` instead of `HTMLDocument` to get their elements.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This branch was previously deployed
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.
Summary
Extract as much mechanical refactoring from the HTML parser change-over into the PR as possible. This leaves the next PR focused on installing the new parser and the ingest-test impact.
Reviewers: Commits are well groomed and reviewing commit-by-commit is probably easier.
Additional Context
This PR introduces the rewritten HTML parser. Its general design is recursive, consistent with the recursive structure of HTML (tree of elements). It also adds the unit tests for that parser but it does not install the parser. So the behavior of
partition_html()is unchanged by this PR. The next PR in this series will do that and handle the ingest and other unit test changes required to reflect the dozen or so bug-fixes the new parser provides.