Skip to content

fix: use module-level access for STORAGE_IMPL to avoid stale None binding#56

Merged
whhe merged 1 commit intooceanbase:mainfrom
whhe:fix-storage-impl-import
Feb 25, 2026
Merged

fix: use module-level access for STORAGE_IMPL to avoid stale None binding#56
whhe merged 1 commit intooceanbase:mainfrom
whhe:fix-storage-impl-import

Conversation

@whhe
Copy link
Member

@whhe whhe commented Feb 25, 2026

from common.settings import STORAGE_IMPL captures the value at import time (None), which is never updated when init_settings() later reassigns it. Switch to from common import settings and access via settings.STORAGE_IMPL so the current value is resolved at call time.

…ding

`from common.settings import STORAGE_IMPL` captures the value at import
time (None), which is never updated when init_settings() later reassigns
it. Switch to `from common import settings` and access via
`settings.STORAGE_IMPL` so the current value is resolved at call time.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 25, 2026
@whhe whhe requested review from Zhangg7723 and Copilot February 25, 2026 09:18
@dosubot dosubot bot added the bug Something isn't working label Feb 25, 2026
@dosubot
Copy link

dosubot bot commented Feb 25, 2026

Related Documentation

Checked 8 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Python import-time binding issue where STORAGE_IMPL was being captured as None at module import time instead of being resolved at runtime after initialization. The fix changes from direct imports (from common.settings import STORAGE_IMPL) to module-level access (from common import settings and settings.STORAGE_IMPL).

Changes:

  • Changed import pattern from direct variable import to module import in 4 files
  • Updated all usages of STORAGE_IMPL to access via settings.STORAGE_IMPL

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
powerrag/server/services/parse_service.py Changed import and updated 2 usages of STORAGE_IMPL to use settings.STORAGE_IMPL
powerrag/server/services/convert_service.py Changed import and updated 1 usage of STORAGE_IMPL to use settings.STORAGE_IMPL
powerrag/parser/vllm_parser.py Changed import and updated 2 usages of STORAGE_IMPL to use settings.STORAGE_IMPL
powerrag/parser/mineru_parser.py Changed import and updated 1 usage of STORAGE_IMPL to use settings.STORAGE_IMPL

@whhe whhe merged commit 1746983 into oceanbase:main Feb 25, 2026
7 checks passed
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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants