ChainedDatasetQueryResults¶
- class lsst.daf.butler.registry.queries.ChainedDatasetQueryResults(chain: Sequence[ParentDatasetQueryResults], doomed_by: Iterable[str] = ())¶
- Bases: - DatasetQueryResults- A - DatasetQueryResultsimplementation that simply chains together other results objects, each for a different parent dataset type.- Parameters:
- chainSequence[ParentDatasetQueryResults]
- The underlying results objects this object will chain together. 
- doomed_byIterable[str], optional
- A list of messages (appropriate for e.g. logging or exceptions) that explain why the query is known to return no results even before it is executed. Queries with a non-empty list will never be executed. Child results objects may also have their own list. 
 
- chain
 - Methods Summary - any(*[, execute, exact])- Test whether this query returns any results. - Group results by parent dataset type. - count(*[, exact])- Count the number of rows this query would return. - expanded()- Return a - DatasetQueryResultsfor which- DataCoordinate.hasRecordsreturns- Truefor all data IDs in returned- DatasetRefobjects.- Return human-readable messages that may help explain why the query yields no results. - Insert this query's results into a temporary table. - Methods Documentation - any(*, execute: bool = True, exact: bool = True) bool¶
- Test whether this query returns any results. - Parameters:
- executebool, optional
- If - True, execute at least a- LIMIT 1query if it cannot be determined prior to execution that the query would return no rows.
- exactbool, optional
- If - True, run the full query and perform post-query filtering if needed, until at least one result row is found. If- False, the returned result does not account for post-query filtering, and hence may be- Trueeven when all result rows would be filtered out.
 
- execute
- Returns:
 
 - byParentDatasetType() Iterator[ParentDatasetQueryResults]¶
- Group results by parent dataset type. - Returns:
- iterIterator[ParentDatasetQueryResults]
- An iterator over - DatasetQueryResultsinstances that are each responsible for a single parent dataset type (either just that dataset type, one or more of its component dataset types, or both).
 
- iter
 
 - count(*, exact: bool = True) int¶
- Count the number of rows this query would return. - Parameters:
- Returns:
- countint
- The number of rows the query would return, or an upper bound if - exact=False.
 
- count
 - Notes - This counts the number of rows returned, not the number of unique rows returned, so even with - exact=Trueit may provide only an upper bound on the number of deduplicated result rows.
 - expanded() ChainedDatasetQueryResults¶
- Return a - DatasetQueryResultsfor which- DataCoordinate.hasRecordsreturns- Truefor all data IDs in returned- DatasetRefobjects.- Returns:
- expandedDatasetQueryResults
- Either a new - DatasetQueryResultsinstance or- self, if it is already expanded.
 
- expanded
 - Notes - As with - DataCoordinateQueryResults.expanded, it may be more efficient to call- materializebefore expanding data IDs for very large result sets.
 - explain_no_results() Iterable[str]¶
- Return human-readable messages that may help explain why the query yields no results. - Returns:
- messagesIterable[str]
- String messages that describe reasons the query might not yield any results. 
 
- messages
 - Notes - Messages related to post-query filtering are only available if the iterator has been exhausted, or if - anyor- countwas already called (with- exact=Truefor the latter two).- This method first yields messages that are generated while the query is being built or filtered, but may then proceed to diagnostics generated by performing what should be inexpensive follow-up queries. Callers can short-circuit this at any time by simplying not iterating further. 
 - materialize() Iterator[ChainedDatasetQueryResults]¶
- Insert this query’s results into a temporary table. - Returns:
- contexttyping.ContextManager[DatasetQueryResults]
- A context manager that ensures the temporary table is created and populated in - __enter__(returning a results object backed by that table), and dropped in- __exit__. If- selfis already materialized, the context manager may do nothing (reflecting the fact that an outer context manager should already take care of everything else).
 
- context