roboto.query.conditions
Module Contents
Comparator
Bases: roboto.compat.StrEnum
The comparator to use when comparing a field to a value.
Attributes
Comparator.BeginsWith
Comparator.Contains
Comparator.Equals
Comparator.Exists
Comparator.GreaterThan
Comparator.GreaterThanOrEqual
Comparator.IsNotNull
Comparator.IsNull
Comparator.LessThan
Comparator.LessThanOrEqual
Comparator.Like
Comparator.NotContains
Comparator.NotEquals
Comparator.NotExists
Comparator.NotLike
Comparator.from_string()
Parameters
value strReturn type
Comparator.to_compact_string()
Condition
Bases: pydantic.BaseModel
A filter for any arbitrary attribute for a Roboto resource.
Parameters
data AnyAttributes
Condition.comparator
Condition.equals_cond()
Parameters
field strvalue ConditionValueReturn type
Condition.matches()
Parameters
target dictReturn type
Condition.target_unspecified()
Is the target resource of this query condition unspecified?
Return type
Condition.targets_dataset()
Does this query condition target a dataset?
Return type
Condition.targets_file()
Does this query condition target a file?
Return type
Condition.targets_message_path()
Does this query condition target a message path?
Return type
Condition.targets_topic()
Does this query condition target a topic?
Return type
Attributes
Condition.value
ConditionGroup
Bases: pydantic.BaseModel
A group of conditions that are combined together.
Parameters
data AnyConditionGroup.and_group()
Parameters
conditions ConditionTypeReturn type
Attributes
ConditionGroup.conditions
ConditionGroup.matches()
Parameters
target dict | Callable[[ConditionType], bool]Attributes
ConditionGroup.operator
ConditionGroup.or_group()
Parameters
conditions ConditionTypeReturn type
ConditionGroup.validate_conditions()
Parameters
v collections.ConditionOperator
Bases: roboto.compat.StrEnum
The operator to use when combining multiple conditions.
ConditionOperator.from_string()
Parameters
value strReturn type
ConditionType
ConditionValue
Field
Bases: str
A string-like field path that parses resource qualifiers and extracts the target path.
Field extends str to provide automatic parsing of qualified field paths like “dataset.metadata.owner” or “topic.name” into their constituent parts. It identifies the target resource type (dataset, file, topic, or message_path) and extracts the actual field path within that resource.
The class supports both qualified paths (e.g., “dataset.org_id”) and unqualified paths (e.g., “org_id”). For qualified paths, it strips the resource prefix and stores both the original fully qualified path and the extracted target information.
Usage
field = Field("dataset.metadata.foo")
field.target.resource
# 'dataset'
field.target.path
# 'metadata.foo'field = Field("org_id")
field.target.resource is None
# True
field.target.path
# 'org_id'Parameters
path strProperties
Field.wrap()
FieldTarget
Bases: NamedTuple
An immutable field path with an optional resource type hint for query interpretation.
FieldTarget pairs a field path with an optional resource qualifier to help the query system resolve which resource type the field belongs to (dataset, file, topic, or message_path). When the resource is omitted, the query context infers it.
Usage
target = FieldTarget("org_id", "dataset")
target.path
# 'org_id'
target.resource
# 'dataset'target = FieldTarget("metadata.min", None)
target.resource is None
# True