QueryResultsBase

class lsst.daf.butler.registry.queries.QueryResultsBase

Bases: LimitedQueryResultsBase

Abstract base class defining functions shared by several of the other QueryResults classes.

Methods Summary

limit(limit[, offset])

Make the iterator return limited number of records.

order_by(*args)

Make the iterator return ordered results.

Methods Documentation

abstract limit(limit: int, offset: int | None = 0) Self

Make the iterator return limited number of records.

Parameters:
limitint

Upper limit on the number of returned records.

offsetint or None, optional

The number of records to skip before returning at most limit records. None is interpreted the same as zero for backwards compatibility.

Returns:
resulttyping.Self

Returns self instance which is updated to return limited set of records.

Notes

This method modifies the iterator in place and returns the same instance to support method chaining. Normally this method is used together with order_by method.

abstract order_by(*args: str) Self

Make the iterator return ordered results.

Parameters:
*argsstr

Names of the columns/dimensions to use for ordering. Column name can be prefixed with minus (-) to use descending ordering.

Returns:
resulttyping.Self

Returns self instance which is updated to return ordered result.

Notes

This method modifies the iterator in place and returns the same instance to support method chaining.