ChainedDatasetQueryResults

class lsst.daf.butler.registry.queries.ChainedDatasetQueryResults(chain: Sequence[lsst.daf.butler.registry.queries._results.ParentDatasetQueryResults])

Bases: lsst.daf.butler.registry.queries.DatasetQueryResults

A DatasetQueryResults implementation that simply chains together other results objects, each for a different parent dataset type.

Parameters:
chain : Sequence [ ParentDatasetQueryResults ]

The underlying results objects this object will chain together.

Methods Summary

byParentDatasetType() Group results by parent dataset type.
expanded() Return a DatasetQueryResults for which DataCoordinate.hasRecords returns True for all data IDs in returned DatasetRef objects.
materialize() Insert this query’s results into a temporary table.

Methods Documentation

byParentDatasetType() → Iterator[lsst.daf.butler.registry.queries._results.ParentDatasetQueryResults]

Group results by parent dataset type.

Returns:
iter : Iterator [ ParentDatasetQueryResults ]

An iterator over DatasetQueryResults instances 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).

expanded() → lsst.daf.butler.registry.queries._results.ChainedDatasetQueryResults

Return a DatasetQueryResults for which DataCoordinate.hasRecords returns True for all data IDs in returned DatasetRef objects.

Returns:
expanded : DatasetQueryResults

Either a new DatasetQueryResults instance or self, if it is already expanded.

Notes

As with DataCoordinateQueryResults.expanded, it may be more efficient to call materialize before expanding data IDs for very large result sets.

materialize() → Iterator[lsst.daf.butler.registry.queries._results.ChainedDatasetQueryResults]

Insert this query’s results into a temporary table.

Returns:
context : typing.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 self is already materialized, the context manager may do nothing (reflecting the fact that an outer context manager should already take care of everything else).