Skip to content

Commit

Permalink
Merge pull request #183 from lsst/tickets/DM-34340
Browse files Browse the repository at this point in the history
DM-34340: Adapt to daf_butler API changes.
  • Loading branch information
TallJimbo authored Nov 22, 2023
2 parents 97e3405 + 2a4170f commit 42c0f89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lsst/ap/association/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 42c0f89

Please sign in to comment.