Skip to content

Commit 1f555db

Browse files
committed
fix failing test
1 parent 571588a commit 1f555db

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
@@ -511,8 +511,8 @@ def _load_extraction_data(self, section) -> ExtractionData:
511511
extraction_results = extraction_data.get("inference_result", {})
512512

513513
if not extraction_results:
514-
raise ValueError(
515-
f"No extraction results found for section {section.section_id}"
514+
logger.warning(
515+
f"No extraction results found for section {section.section_id}, skipping assessment"
516516
)
517517

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

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

0 commit comments

Comments
 (0)