Why this change is needed:
The E2E test test_backward_compat_old_workspace_naming_qdrant was failing
because _find_legacy_collection() searched for generic "lightrag_vdb_{namespace}"
before workspace-specific "{workspace}_{namespace}" collections. When both
existed, it would always find the generic one first (which might be empty),
ignoring the workspace collection that actually contained the data to migrate.
How it solves it:
Reordered the candidates list in _find_legacy_collection() to prioritize
more specific naming patterns over generic ones:
1. {workspace}_{namespace} (most specific, old workspace format)
2. lightrag_vdb_{namespace} (generic legacy format)
3. {namespace} (most generic, oldest format)
This ensures the migration finds the correct source collection with actual data.
Impact:
- Fixes test_backward_compat_old_workspace_naming_qdrant which creates
a "prod_chunks" collection with 10 points
- Migration will now correctly find and migrate from workspace-specific
legacy collections before falling back to generic collections
- Maintains backward compatibility with all legacy naming patterns
Testing:
Run: pytest tests/test_e2e_multi_instance.py::test_backward_compat_old_workspace_naming_qdrant -v
|
||
|---|---|---|
| .. | ||
| api | ||
| evaluation | ||
| kg | ||
| llm | ||
| tools | ||
| __init__.py | ||
| base.py | ||
| constants.py | ||
| exceptions.py | ||
| lightrag.py | ||
| namespace.py | ||
| operate.py | ||
| prompt.py | ||
| rerank.py | ||
| types.py | ||
| utils.py | ||
| utils_graph.py | ||