fix: use module-level access for STORAGE_IMPL to avoid stale None binding#56
Merged
whhe merged 1 commit intooceanbase:mainfrom Feb 25, 2026
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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_IMPLto access viasettings.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 |
Zhangg7723
approved these changes
Feb 25, 2026
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.
from common.settings import STORAGE_IMPLcaptures the value at import time (None), which is never updated when init_settings() later reassigns it. Switch tofrom common import settingsand access viasettings.STORAGE_IMPLso the current value is resolved at call time.