Skip to content

fix(zim): correct config_indexing docstring to full-text only#297

Merged
benoit74 merged 1 commit into
openzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-294
May 26, 2026
Merged

fix(zim): correct config_indexing docstring to full-text only#297
benoit74 merged 1 commit into
openzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-294

Conversation

@Bojun-Vvibe
Copy link
Copy Markdown

Closes #294

Repo

openzim/python-scraperlib

Issue

#294

Root cause

The docstring of Creator.config_indexing in src/zimscraperlib/zim/creator.py stated it toggled "full-text and title indexing of entries". In reality, libzim's config_indexing only 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_indexing to 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_text asserts 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 textual module 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.

@benoit74 benoit74 marked this pull request as ready for review May 26, 2026 13:30
@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-294 branch 2 times, most recently from 554db68 to f2f4f1c Compare May 26, 2026 13:30
@benoit74 benoit74 self-requested a review May 26, 2026 13:31
@benoit74
Copy link
Copy Markdown
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.
@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-294 branch from f2f4f1c to e8708cb Compare May 26, 2026 14:08
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (ff65d77) to head (e8708cb).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74 benoit74 merged commit d6bd4b3 into openzim:main May 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix documentation of config_indexing

2 participants