Fix(api): correct document parsing progress check logic (#6318)

- Fix incorrect progress check condition that prevented re-parsing of
completed documents
- Allow parsing for documents with progress 0.0 (not started) or 1.0
(completed)
- Only block parsing for documents currently in progress (0.0 < progress
< 1.0)

Close #6312

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
hy89
2025-03-20 16:00:17 +08:00
committed by GitHub
parent f0c4b28c6b
commit 1d9ca172e3
2 changed files with 3 additions and 4 deletions

View File

@ -205,8 +205,7 @@ class TestDocumentsParse:
res = parse_documnet(
get_http_api_auth, dataset_id, {"document_ids": document_ids}
)
assert res["code"] == 102
assert res["message"] == "Can't stop parsing document with progress at 0 or 100"
assert res["code"] == 0
@pytest.mark.skip(reason="issues/6234")
def test_duplicate_parse(self, get_http_api_auth, tmp_path):