Skip to content

Commit ec199ae

Browse files
Cheticclaude
andcommitted
fix: break circular import between index.py and docx_utils.py
Move the import of EXCLUDED_EMBED_METADATA_KEYS, EXCLUDED_LLM_METADATA_KEYS, and get_heading_store to inside split_docx_into_heading_documents() to avoid the index -> docx_utils -> index circular import at module load time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a4ee99d commit ec199ae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/chunksilo/docx_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from llama_index.core import Document as LlamaIndexDocument
1717

1818
from . import cfgload
19-
from .index import EXCLUDED_EMBED_METADATA_KEYS, EXCLUDED_LLM_METADATA_KEYS, get_heading_store
2019

2120
if TYPE_CHECKING:
2221
from .ui import FileProcessingContext
@@ -117,6 +116,9 @@ def split_docx_into_heading_documents(
117116
docx_path: Path to DOCX file
118117
ctx: Optional processing context for progress updates and timeout
119118
"""
119+
# Lazy import to avoid circular dependency (index.py imports docx_utils)
120+
from .index import EXCLUDED_EMBED_METADATA_KEYS, EXCLUDED_LLM_METADATA_KEYS, get_heading_store
121+
120122
docs: list[LlamaIndexDocument] = []
121123

122124
if ctx:

0 commit comments

Comments
 (0)