Skip to content

Commit

Permalink
Ban multiple-dataset-type results in general find-first queries.
Browse files Browse the repository at this point in the history
Supporting these would be extra complexity I don't think we need.
  • Loading branch information
TallJimbo committed Oct 15, 2024
1 parent 43eb67c commit 39ab698
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/lsst/daf/butler/queries/result_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ class GeneralResultSpec(ResultSpecBase):
def find_first_dataset(self) -> str | None:
# Docstring inherited.
if self.find_first:
if len(self.dataset_fields) != 1:
raise InvalidQueryError(
"General query with find_first=True cannot have results from multiple "
"dataset searches."
)
(dataset_type,) = self.dataset_fields.keys()
return dataset_type
return None
Expand Down

0 comments on commit 39ab698

Please sign in to comment.