Repository navigation
fix(mapper): use the Lexbor parser in clean_html_mapper - #1085
Merged
cmgzn merged 1 commit intoOct 8, 2026
Merged
Conversation
selectolax 1.0 (2026-10-03) removed the Modest backend, so importing selectolax.parser raises ImportError, which LazyLoader reports as "module 'selectolax' has no attribute 'parser'". pyproject.toml allows any selectolax version, so a fresh pip install breaks clean_html_mapper. Use selectolax.lexbor.LexborHTMLParser, available since selectolax 0.3, which produces the same text for all test cases.
cristianchiriac
temporarily deployed
to
Testing
October 6, 2026 12:58 — with
GitHub Actions
Inactive
cristianchiriac
temporarily deployed
to
Testing
October 6, 2026 12:58 — with
GitHub Actions
Inactive
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.
selectolax 1.0.0 (released 2026-10-03) removed the Modest backend, so
import selectolax.parsernow raisesImportError.clean_html_mappercallsselectolax.parser.HTMLParserthroughLazyLoader, which turns that into:pyproject.tomllistsselectolaxwithout a version bound, so a freshpip installgets 1.0 and the operator fails on every sample.uv.lockstill pins 0.3.30, which is whyuv syncenvironments and CI haven't hit it yet.This switches the operator to
selectolax.lexbor.LexborHTMLParser. It has been available since selectolax 0.3, andLazyLoaderresolves thelexborsubmodule the same way it didparser.Testing (
pytest tests/ops/mapper/test_clean_html_mapper.py, Python 3.12):AttributeErroraboveI also compared the Modest and Lexbor output directly on all 26
text/targetsamples in that test file. Both backends return exactly the expected text for every sample, so the cleaned output doesn't change.I didn't run the rest of the suite. On Windows the editable install needs MSVC, so I ran this test file against the dependencies from
pyproject.tomlwithPYTHONPATH=..