From 050fc1b83f465be8819f93c16c3a26d5942dc592 Mon Sep 17 00:00:00 2001 From: Nate Lust Date: Wed, 16 Apr 2025 17:19:46 -0400 Subject: [PATCH] Sasquatch datastore should not bring down graph. The Sasquatch datastore should not bring down execution of a quantum graph if for some reason Sasquatch could not be reached, ie. netwrok issues. Catch dispatch errors and pass so the bundle will be written to the butler and exectuion can continue. --- .../tools/interfaces/datastore/_sasquatchDatastore.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/lsst/analysis/tools/interfaces/datastore/_sasquatchDatastore.py b/python/lsst/analysis/tools/interfaces/datastore/_sasquatchDatastore.py index cf15fd126..60233644e 100644 --- a/python/lsst/analysis/tools/interfaces/datastore/_sasquatchDatastore.py +++ b/python/lsst/analysis/tools/interfaces/datastore/_sasquatchDatastore.py @@ -36,7 +36,7 @@ from lsst.daf.butler.registry.interfaces import DatastoreRegistryBridge from lsst.resources import ResourcePath, ResourcePathExpression -from . import SasquatchDispatcher +from . import SasquatchDispatcher, SasquatchDispatchFailure, SasquatchDispatchPartialFailure if TYPE_CHECKING: from lsst.daf.butler import Config, DatasetProvenance, DatasetType, LookupKey @@ -155,7 +155,12 @@ def put( self, inMemoryDataset: Any, ref: DatasetRef, *, provenance: DatasetProvenance | None = None ) -> None: if self.constraints.isAcceptable(ref): - self._dispatcher.dispatchRef(inMemoryDataset, ref, extraFields=self.extra_fields) + try: + self._dispatcher.dispatchRef(inMemoryDataset, ref, extraFields=self.extra_fields) + except SasquatchDispatchFailure: + log.warning("Failed to dispatch metric bundle to Sasquatch.") + except SasquatchDispatchPartialFailure: + log.warning("Only some of the metrics were successfully dispatched to Sasquatch.") else: log.debug("Could not put dataset type %s with Sasquatch datastore", ref.datasetType) raise DatasetTypeNotSupportedError(