ScalarExpressionProxy#
- class lsst.daf.butler.queries.expression_factory.ScalarExpressionProxy#
Bases:
ExpressionProxyAn
ExpressionProxyspecialized for simple single-value columns.Attributes Summary
An ordering expression that indicates that the sort on this expression should be reversed.
Methods Summary
If this scalar expression is a boolean, convert it to a
Predicateso it can be used as a boolean expression.glob(pattern)Return a boolean expression that matches this expression against pattern.
in_iterable(others)Return a boolean expression that tests whether this expression evaluates to a value that is in an iterable of other expressions.
in_query(column, query)Return a boolean expression that test whether this expression evaluates to a value that is in a single-column selection from another query.
in_range([start, stop, step])Return a boolean expression that tests whether this expression is within a literal integer range.
Attributes Documentation
- desc#
An ordering expression that indicates that the sort on this expression should be reversed.
Methods Documentation
- as_boolean() Predicate#
If this scalar expression is a boolean, convert it to a
Predicateso it can be used as a boolean expression.Raises#
- InvalidQueryError
If this expression is not a boolean.
Returns#
- predicate
Predicate This expression converted to a
Predicate.
- glob(pattern: str) Predicate#
Return a boolean expression that matches this expression against pattern.
Parameters#
- pattern
str Pattern to use for matching.
Returns#
- predicate
tree.Predicate Boolean expression object.
- pattern
- in_iterable(others: Iterable) Predicate#
Return a boolean expression that tests whether this expression evaluates to a value that is in an iterable of other expressions.
Parameters#
- others
collections.abc.Iterable An iterable of
ExpressionProxyor values to be interpreted as literals.
Returns#
- predicate
tree.Predicate Boolean expression object.
- others
- in_query(column: ExpressionProxy, query: Query) tree.Predicate#
Return a boolean expression that test whether this expression evaluates to a value that is in a single-column selection from another query.
Parameters#
- column
ExpressionProxy Proxy for the column to extract from
query.- query
Query Query to select from.
Returns#
- predicate
tree.Predicate Boolean expression object.
- column
- in_range(start: int = 0, stop: int | None = None, step: int = 1) Predicate#
Return a boolean expression that tests whether this expression is within a literal integer range.
Parameters#
- start
int, optional Lower bound (inclusive) for the slice.
- stop
intorNone, optional Upper bound (exclusive) for the slice, or
Nonefor no bound.- step
int, optional Spacing between integers in the range.
Returns#
- predicate
tree.Predicate Boolean expression object.
- start