From 262257b8ae8058760f9e05b5aa80da1a35f51a37 Mon Sep 17 00:00:00 2001 From: Krzysztof Findeisen Date: Thu, 24 Jul 2025 11:34:26 -0700 Subject: [PATCH] Catch missing local collections in _find_calibs. This is essentially a port of 5a8ee0dba844a5efc46a9537c0d631e128f2cae1 to query_calibs_by_date, and patches the whole in allowing incomplete local repos during preload. --- python/activator/middleware_interface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/activator/middleware_interface.py b/python/activator/middleware_interface.py index 973198fc..d48c9770 100644 --- a/python/activator/middleware_interface.py +++ b/python/activator/middleware_interface.py @@ -822,10 +822,11 @@ def query_calibs_by_date(butler, label): .where(expr[dataset_type.name].timespan.overlaps(calib_date)) .with_dimension_records() ) - except (DataIdValueError, MissingDatasetTypeError) as e: + except (DataIdValueError, MissingDatasetTypeError, MissingCollectionError) as e: # Dimensions/dataset type often invalid for fresh local repo, # where there are no, and never have been, any matching datasets. - # It *is* a problem for the central repo, but can be caught later. + # May have dimensions but no collections if a previous preload failed. + # These *are* a problem for the central repo, but can be caught later. _log.debug("%s query failed with %s.", label, e) datasets = set() # Trace3 because, in many contexts, datasets is too large to print.