diff --git a/python/lsst/ap/association/metrics.py b/python/lsst/ap/association/metrics.py index 316c2349..cf0126af 100644 --- a/python/lsst/ap/association/metrics.py +++ b/python/lsst/ap/association/metrics.py @@ -326,8 +326,10 @@ def makeMeasurement(self, dbHandle, outputDataId): ValueError Raised if outputDataId is not empty """ - # All data ID types define keys() - if outputDataId.keys() - {'instrument'}: + # DataCoordinate objects are not mappings, so they don't have keys(), + # but their .required attribute is a mapping. + mapping = getattr(outputDataId, "required", outputDataId) + if mapping.keys() - {'instrument'}: raise ValueError("%s must not be associated with specific data IDs (gave %s)." % (self.config.metricName, outputDataId))