mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-15 21:16:03 +08:00
fix: improve incremental wiki compilation (#18164)
This commit is contained in:
@@ -381,3 +381,39 @@ def test_string_list_decodes_legacy_json_and_native_arrays(monkeypatch):
|
||||
assert module._string_list('["doc_1", "doc_2"]') == ["doc_1", "doc_2"]
|
||||
assert module._string_list(["doc_1", "doc_2", "doc_1"]) == ["doc_1", "doc_2"]
|
||||
assert module._string_list("doc_1###doc_2") == ["doc_1", "doc_2"]
|
||||
|
||||
|
||||
def test_wiki_alteration_treats_wiki_template_as_eligible(monkeypatch):
|
||||
module, _, _ = _load_list_datasets_module(
|
||||
monkeypatch,
|
||||
kbs=[],
|
||||
parsing_status_by_kb={},
|
||||
)
|
||||
_stub(
|
||||
monkeypatch,
|
||||
"api.db.services.compilation_template_service",
|
||||
CompilationTemplateService=SimpleNamespace(
|
||||
get_saved=lambda template_id, tenant_id: {
|
||||
"id": template_id,
|
||||
"kind": "wiki",
|
||||
"config": {"kind": "wiki"},
|
||||
}
|
||||
),
|
||||
)
|
||||
_stub(monkeypatch, "rag.svr", __path__=[])
|
||||
_stub(monkeypatch, "rag.svr.task_executor_refactor", __path__=[])
|
||||
_stub(
|
||||
monkeypatch,
|
||||
"rag.svr.task_executor_refactor.chunk_post_processor",
|
||||
_parser_config_compilation_template_ids=lambda parser_config, tenant_id: parser_config.get("compilation_template_ids", []),
|
||||
)
|
||||
|
||||
docs = [
|
||||
{
|
||||
"id": "doc-wiki",
|
||||
"status": "1",
|
||||
"parser_config": {"compilation_template_ids": ["template-wiki"]},
|
||||
}
|
||||
]
|
||||
|
||||
assert module._eligible_doc_ids_for_kind(docs, "tenant-1", "wiki") == {"doc-wiki"}
|
||||
|
||||
Reference in New Issue
Block a user