Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(triplet-store): preserve missing backend dependency errors

林SOb52cdd5bbeb4
diff --git a/semantica/triplet_store/triplet_store.py b/semantica/triplet_store/triplet_store.py
index 7c740722..18d1a965 100644
--- a/semantica/triplet_store/triplet_store.py
+++ b/semantica/triplet_store/triplet_store.py
@@ -156,9 +156,11 @@ class TripletStore:
self.logger.info(f"Initialized {self.backend_type} backend")
+ except ImportError:
+ raise
except Exception as e:
self.logger.error(f"Failed to initialize {self.backend_type} backend: {e}")
- raise ProcessingError(f"Failed to initialize backend: {e}")
+ raise ProcessingError(f"Failed to initialize backend: {e}") from e
def store(
self,
diff --git a/tests/triplet_store/test_oxigraph_store.py b/tests/triplet_store/test_oxigraph_store.py
index 40e0b9b1..cbd3c979 100644
--- a/tests/triplet_store/test_oxigraph_store.py
+++ b/tests/triplet_store/test_oxigraph_store.py
@@ -158,4 +158,4 @@ def test_missing_optional_dependency_has_install_hint():
side_effect=import_without_oxigraph,
):
with pytest.raises(ImportError, match="tripletstore-oxigraph"):
- OxigraphStore()
+ _store()