ScalarExpressionProxy

class lsst.daf.butler.queries.expression_factory.ScalarExpressionProxy

Bases: ExpressionProxy

An ExpressionProxy specialized for simple single-value columns.

Attributes Summary

desc

An ordering expression that indicates that the sort on this expression should be reversed.

is_null

A boolean expression that tests whether this expression is NULL.

Methods Summary

as_boolean()

If this scalar expression is a boolean, convert it to a Predicate so it can be used as a boolean expression.

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.

is_null

A boolean expression that tests whether this expression is NULL.

Methods Documentation

as_boolean() Predicate

If this scalar expression is a boolean, convert it to a Predicate so it can be used as a boolean expression.

Returns:
predicatePredicate

This expression converted to a Predicate.

Raises:
InvalidQueryError

If this expression is not a boolean.

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:
otherscollections.abc.Iterable

An iterable of ExpressionProxy or values to be interpreted as literals.

Returns:
predicatetree.Predicate

Boolean expression object.

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:
columnExpressionProxy

Proxy for the column to extract from query.

queryQuery

Query to select from.

Returns:
predicatetree.Predicate

Boolean expression object.

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:
startint, optional

Lower bound (inclusive) for the slice.

stopint or None, optional

Upper bound (exclusive) for the slice, or None for no bound.

stepint, optional

Spacing between integers in the range.

Returns:
predicatetree.Predicate

Boolean expression object.