QuerySummary

class lsst.daf.butler.registry.queries.QuerySummary(requested: DimensionGraph, *, dataId: DataCoordinate | None = None, expression: str | QueryWhereExpression | None = None, whereRegion: Region | None = None, bind: Mapping[str, Any] | None = None, defaults: DataCoordinate | None = None, datasets: Iterable[DatasetType] = (), order_by: Iterable[str] | None = None, limit: Tuple[int, int | None] | 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:
requestedDimensionGraph

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

dataIdDataCoordinate, optional

A fully-expanded data ID identifying dimensions known in advance. If not provided, will be set to an empty data ID. dataId.hasRecords() must return True.

expressionstr or QueryWhereExpression, optional

A user-provided string WHERE expression.

whereRegionlsst.sphgeom.Region, optional

A spatial region that all rows must overlap. If None and dataId is not None, dataId.region will be used.

bindMapping [ str, object ], optional

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

defaultsDataCoordinate, optional

A data ID containing default for governor dimensions.

datasetsIterable [ 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_byIterable [ str ]

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

limitTuple, optional

Limit on the number of returned rows and optional offset.

checkbool

If True (default) check the query for consistency. This may reject some valid queries that resemble common mistakes (e.g. queries for visits without specifying an instrument).

Attributes Summary

mustHaveKeysJoined

Dimensions whose primary keys must be used in the JOIN ON clauses of the query, even if their tables do not appear (DimensionGraph).

mustHaveTableJoined

Dimension elements whose associated tables must appear in the query's FROM clause (NamedValueSet of DimensionElement).

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

mustHaveKeysJoined

Dimensions whose primary keys must be used in the JOIN ON clauses of the query, even if their tables do not appear (DimensionGraph).

A Dimension primary key can appear in a join clause without its table via a foreign key column in table of a dependent dimension element or dataset.

mustHaveTableJoined

Dimension elements whose associated tables must appear in the query’s FROM clause (NamedValueSet of DimensionElement).

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).