QuerySummary

class lsst.daf.butler.registry.queries.QuerySummary(requested: lsst.daf.butler.core.dimensions._graph.DimensionGraph, *, data_id: Optional[lsst.daf.butler.core.dimensions._coordinate.DataCoordinate, None] = None, expression: str = '', region: Optional[lsst.sphgeom._sphgeom.Region, None] = None, timespan: Optional[lsst.daf.butler.core.timespan.Timespan, None] = None, bind: Optional[collections.abc.Mapping[str, Any], None] = None, defaults: Optional[lsst.daf.butler.core.dimensions._coordinate.DataCoordinate, None] = None, datasets: collections.abc.Iterable[lsst.daf.butler.core.datasets.type.DatasetType] = (), order_by: Optional[collections.abc.Iterable[str], None] = None, limit: Optional[tuple, None] = None, check: bool = True)

Bases: object

A struct that holds and categorizes the dimensions involved in a query.

A QuerySummary instance is necessary to construct a QueryBuilder, and it needs to include all of the dimensions that will be included in the query (including any needed for querying datasets).

Parameters:
requested : DimensionGraph

The dimensions whose primary keys should be included in the result rows of the query.

data_id : DataCoordinate, optional

A fully-expanded data ID identifying dimensions known in advance. If not provided, will be set to an empty data ID.

expression : str, optional

A user-provided string WHERE expression.

region : lsst.sphgeom.Region, optional

If None and data_id is an expanded data ID, data_id.region will be used to construct one.

timespan : Timespan, optional

A temporal constraint that all rows must overlap. If None and data_id is an expanded data ID, data_id.timespan will be used to construct one.

bind : Mapping [ str, object ], optional

Mapping containing literal values that should be injected into the query expression, keyed by the identifiers they replace.

defaults : DataCoordinate, optional

A data ID containing default for governor dimensions.

datasets : Iterable [ DatasetType ], optional

Dataset types whose searches may be joined into the query. Callers must still call QueryBuilder.joinDataset explicitly to control how that join happens (e.g. which collections are searched), but by declaring them here first we can ensure that the query includes the right dimensions for those joins.

order_by : Iterable [ str ]

Sequence of names to use for ordering with optional “-” prefix.

limit : Tuple, optional

Limit on the number of returned rows and optional offset.

check : bool, optional

If False, permit expressions to refer to dimensions without providing a value for their governor dimensions (e.g. referring to a visit without an instrument). Should be left to default to True in essentially all new code.

Attributes Summary

spatial Dimension elements whose regions and skypix IDs should be included in the query (NamedValueAbstractSet of DimensionElement).
temporal Dimension elements whose timespans should be included in the query (NamedValueSet of DimensionElement).
universe All known dimensions (DimensionUniverse).

Attributes Documentation

spatial

Dimension elements whose regions and skypix IDs should be included in the query (NamedValueAbstractSet of DimensionElement).

temporal

Dimension elements whose timespans should be included in the query (NamedValueSet of DimensionElement).

universe

All known dimensions (DimensionUniverse).