Skip to content

fix(pipeline): default missing feature configs - #5371

Open
RerankerGuo wants to merge 1 commit into
opendatalab:devfrom
RerankerGuo:fix/issue-5317-missing-pipeline-config
Open

fix(pipeline): default missing feature configs#5371
RerankerGuo wants to merge 1 commit into
opendatalab:devfrom
RerankerGuo:fix/issue-5317-missing-pipeline-config

Conversation

@RerankerGuo

Copy link
Copy Markdown

Motivation

Fixes #5317.

MineruPipelineModel assumes both formula_config and table_config are
dictionaries. Direct integrations that omit either optional config, or pass
it as None, fail before model initialization:

AttributeError: 'NoneType' object has no attribute 'get'

The standard CLI supplies both dictionaries, but the model class accepts
keyword arguments directly and should preserve its documented default-enabled
behavior when those optional dictionaries are absent.

Modification

  • Normalize a missing or None formula_config to an empty dictionary.
  • Normalize a missing or None table_config to an empty dictionary.
  • Add regression coverage for omitted configs, explicit None, and explicit
    {"enable": False} values.
  • Mock atom model creation in the tests, so no weights are downloaded and no
    GPU is required.

BC-breaking (Optional)

No. Missing configs now use the existing default of enable=True. Explicit
enable=False values remain unchanged.

Verification

The same regression test was run against the original and patched code.

Before:

2 failed, 1 passed
AttributeError: 'NoneType' object has no attribute 'get'

After:

3 passed

Commands:

PYTHONPATH=. uv run --python 3.12 --with pytest --with torch \
  --with torchvision --with loguru --with numpy --with opencv-python \
  --with transformers --with modelscope --with pypdfium2 --with pypdf \
  --with pdftext --with pillow --with shapely --with pyclipper \
  --with onnxruntime --with fast-langdetect --with six \
  --with beautifulsoup4 --no-project pytest -q -o addopts='' \
  tests/unittest/test_pipeline_model_config.py

uvx ruff check --ignore ANN mineru/backend/pipeline/model_init.py
uvx ruff check tests/unittest/test_pipeline_model_config.py

No model or GPU end-to-end run is needed for this constructor-level change;
the regression test replaces all atom model factories and exercises the
configuration boundary directly.

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests.
  • Documentation impact was reviewed; no public API documentation change is needed.

After PR:

  • No downstream API or model behavior changes for explicit configurations.
  • CLA has already been signed by this contributor.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 8, 2026
@RerankerGuo
RerankerGuo force-pushed the fix/issue-5317-missing-pipeline-config branch from abbd2bc to 5c1542a Compare August 8, 2026 12:03
@RerankerGuo
RerankerGuo changed the base branch from master to dev August 8, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'NoneType' object has no attribute 'get'

1 participant