OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
verbage fix for clarity and correctness
Mike Fortmand3794a976e2b
diff --git a/src/utils/opensearch_utils.py b/src/utils/opensearch_utils.pyindex cf2b343ad..c404b1ca4 100644--- a/src/utils/opensearch_utils.py+++ b/src/utils/opensearch_utils.py@@ -6,7 +6,7 @@ from utils.logging_config import get_loggerlogger = get_logger(__name__)DISK_SPACE_ERROR_MESSAGE = (- "OpenSearch disk usage has exceeded the critical threshold (>90%). "+ "OpenSearch has run out of available disk space. ""Search and indexing operations are blocked. ""Please free up disk space to restore OpenRAG functionality.")@@ -30,14 +30,14 @@ class OpenSearchNotReadyError(Exception):class OpenSearchDiskSpaceError(Exception):- """Raised when OpenSearch operations fail due to insufficient disk space (>90% used)."""+ """Raised when OpenSearch operations fail due to insufficient disk space."""def is_disk_space_error(error: Exception) -> bool:"""Check whether an exception is caused by OpenSearch disk space constraints.OpenSearch blocks write and search operations when disk usage crosses- the high-watermark (default 90%) or flood-stage watermark (default 95%).+ the high-watermark or flood-stage watermark thresholds.This function detects those error signatures.Args:diff --git a/tests/unit/test_opensearch_disk_space.py b/tests/unit/test_opensearch_disk_space.pyindex 05e4c380e..6de9fbe09 100644--- a/tests/unit/test_opensearch_disk_space.py+++ b/tests/unit/test_opensearch_disk_space.py@@ -1,8 +1,8 @@"""Unit tests for OpenSearch disk space error detection.-When OpenSearch disk usage exceeds the high-watermark (90%) or flood-stage-watermark (95%), it blocks operations and returns errors with specific+When OpenSearch disk usage exceeds the high-watermark or flood-stage+watermark, it blocks operations and returns errors with specificsignatures. These tests verify that those signatures are correctly detectedand surfaced as OpenSearchDiskSpaceError."""@@ -69,8 +69,8 @@ class TestIsDiskSpaceError:# ---------------------------------------------------------------------------class TestDiskSpaceErrorMessage:- def test_message_mentions_threshold(self):- assert "90%" in DISK_SPACE_ERROR_MESSAGE+ def test_message_mentions_disk_space_blocked(self):+ assert "run out of available disk space" in DISK_SPACE_ERROR_MESSAGE.lower()def test_message_mentions_disk_space(self):assert "disk" in DISK_SPACE_ERROR_MESSAGE.lower()