fix(zim): correct config_indexing docstring to full-text only#297
Merged
benoit74 merged 1 commit intoMay 26, 2026
Merged
Conversation
554db68 to
f2f4f1c
Compare
Collaborator
|
@Bojun-Vvibe thank you. I've removed the test since it is not of much use IMHO and I will merge. |
The docstring of Creator.config_indexing claimed it toggled both full-text and title indexing, but libzim only toggles the full-text index; the title index is always built. Update the docstring to reflect libzim's actual behaviour and add a regression test.
f2f4f1c to
e8708cb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #297 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 41 41
Lines 2542 2542
Branches 362 362
=======================================
Hits 2541 2541
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 #294
Repo
openzim/python-scraperlib
Issue
#294
Root cause
The docstring of
Creator.config_indexinginsrc/zimscraperlib/zim/creator.pystated it toggled "full-text and title indexing of entries". In reality, libzim'sconfig_indexingonly toggles the full-text index; the title index is always built. The python-scraperlib documentation was therefore misleading.Fix
Updated the docstring of
Creator.config_indexingto state it toggles full-text indexing only and added an explicit note that title indexing is always performed by libzim and cannot be disabled via this method.Regression test
tests/zim/test_zim_creator.py::test_config_indexing_docstring_only_mentions_full_textasserts the docstring contains "full-text" and does NOT contain the misleading phrase "full-text and title indexing".Risk
trivial
Verification
Local pytest plugin environment was broken (missing
textualmodule unrelated to this repo). Verified the fix via AST inspection of the updated source: the docstring contains "full-text" and no longer contains "full-text and title indexing" — matching the regression test's assertions. Result: PASS.