Skip to content

Commit c3b2dba

Browse files
committed
fix failing test
1 parent 5e1aa2a commit c3b2dba

File tree

1 file changed

+9
-2
lines changed
  • lib/idp_common_pkg/idp_common/assessment

1 file changed

+9
-2
lines changed

lib/idp_common_pkg/idp_common/assessment/service.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ def _load_extraction_data(self, section) -> ExtractionData:
513513
extraction_results = extraction_data.get("inference_result", {})
514514

515515
if not extraction_results:
516-
raise ValueError(
517-
f"No extraction results found for section {section.section_id}"
516+
logger.warning(
517+
f"No extraction results found for section {section.section_id}, skipping assessment"
518518
)
519519

520520
return ExtractionData(
@@ -917,6 +917,13 @@ def process_document_section(self, document: Document, section_id: str) -> Docum
917917
t1 = time.time()
918918
logger.info(f"Time taken to load extraction data: {t1 - t0:.2f} seconds")
919919

920+
# Handle empty extraction results gracefully
921+
if not extraction_results:
922+
logger.warning(
923+
f"No extraction results for section {section_id}, skipping assessment"
924+
)
925+
return document
926+
920927
# Load document content (text, images, OCR confidence)
921928
document_content = self._load_document_content(document, section)
922929
t2 = time.time()

0 commit comments

Comments
 (0)