Skip to content

Commit

Permalink
Change explain_no_results return type from Iterator to Iterable.
Browse files Browse the repository at this point in the history
Minor API change from RFC-878, preparing for a future ticket to not
make these lazy iterators at all.
  • Loading branch information
TallJimbo committed Sep 26, 2022
1 parent 97ab792 commit c88edb3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/lsst/daf/butler/registry/queries/_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,13 @@ def any(
"""
return self._query.any(self._db, execute=execute, exact=exact)

def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
"""Return human-readable messages that may help explain why the query
yields no results.
Returns
-------
messages : `Iterator` [ `str` ]
messages : `Iterable` [ `str` ]
String messages that describe reasons the query might not yield any
results.
Expand Down Expand Up @@ -651,13 +651,13 @@ def any(
raise NotImplementedError()

@abstractmethod
def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
"""Return human-readable messages that may help explain why the query
yields no results.
Returns
-------
messages : `Iterator` [ `str` ]
messages : `Iterable` [ `str` ]
String messages that describe reasons the query might not yield any
results.
Expand Down Expand Up @@ -814,7 +814,7 @@ def any(
# Docstring inherited.
return self._query.any(self._db, execute=execute, exact=exact)

def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
# Docstring inherited.
return self._query.explain_no_results(self._db)

Expand Down Expand Up @@ -873,7 +873,7 @@ def any(
# Docstring inherited.
return any(r.any(execute=execute, exact=exact) for r in self._chain)

def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
# Docstring inherited.
for r in self._chain:
yield from r.explain_no_results()
Expand Down Expand Up @@ -984,13 +984,13 @@ def limit(self, limit: int, offset: int | None = None) -> DimensionRecordQueryRe
raise NotImplementedError()

@abstractmethod
def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
"""Return human-readable messages that may help explain why the query
yields no results.
Returns
-------
messages : `Iterator` [ `str` ]
messages : `Iterable` [ `str` ]
String messages that describe reasons the query might not yield any
results.
Expand Down Expand Up @@ -1135,6 +1135,6 @@ def limit(self, limit: int, offset: Optional[int] = None) -> DimensionRecordQuer
self._dataIds = self._dataIds.limit(limit, offset)
return self

def explain_no_results(self) -> Iterator[str]:
def explain_no_results(self) -> Iterable[str]:
# Docstring inherited.
return self._dataIds.explain_no_results()

0 comments on commit c88edb3

Please sign in to comment.