---
sidebar:
  label: roboto.query.filters
  order: 3
title: roboto.query.filters
---
## Module Contents

### BooleanFilter

```python
class roboto.query.filters.BooleanFilter(/, **data: Any)
```

`from roboto.query import BooleanFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L462-L489)

Bases: `_EqualityFilterBase`

Filter on a true-or-false field.

Building one raises `pydantic.ValidationError` when `comparator` is an operator the filter does not offer, when `comparator` is [`Equals`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.Equals) and `values` holds no value or more than two, or when `or_null` is set with any other comparator.

**Parameters**

- **data** (`Any`)

**Attributes**

- **BooleanFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Equals, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull]`): Operator the filter applies.
- **BooleanFilter.type** (`Literal['boolean']`) = `'boolean'`: Kind of filter, always `"boolean"`.
- **BooleanFilter.values** (`list[bool]`) = `None`: Values the field may equal, one or both of `True` and `False`; empty when `comparator` takes none.

### CUSTOM_FIELD_PREFIX

```python
roboto.query.filters.CUSTOM_FIELD_PREFIX: Final[str] = 'custom.'
```

`from roboto.query import CUSTOM_FIELD_PREFIX`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L16-L16)

Prefix that names one of the organization's custom fields in a query's field.

`custom.<field_name>` names the custom field `<field_name>` wherever a query takes a field: [`field`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Condition.field), [`sort_by`](/docs/reference/python-sdk/roboto/query/specification#roboto.query.specification.QuerySpecification.sort_by), `field`, and a saved filter's `field`. No SDK method reads it.

### DateFilter

```python
class roboto.query.filters.DateFilter(/, **data: Any)
```

`from roboto.query import DateFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L405-L459)

Bases: `_FilterBase`

Filter on a date field, by a time, a range, or a time window relative to when the filter runs.

Building one raises `pydantic.ValidationError` when:

- `comparator` is an operator the filter does not offer.
- `comparator` is `FilterOnlyComparator.Between` and `values` does not hold exactly two non-blank ISO 8601 dates, or the second is before the first.
- `comparator` is [`LessThan`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.LessThan) or [`GreaterThan`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.GreaterThan) and the first value is missing, blank, or not an ISO 8601 date.

**Parameters**

- **data** (`Any`)

**Attributes**

- **DateFilter.comparator** (`Literal[roboto.query.conditions.Comparator.LessThan, roboto.query.conditions.Comparator.GreaterThan, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator, FilterOnlyComparator]`): Operator the filter applies.

- **DateFilter.type** (`Literal['date']`) = `'date'`: Kind of filter, always `"date"`.

- **DateFilter.values** (`list[str]`) = `None`: Dates to compare the field with, as ISO 8601 strings, empty when `comparator` takes none.

  Stored as written. A date with no UTC offset is read as UTC when two are compared.

### EnumFilter

```python
class roboto.query.filters.EnumFilter(/, **data: Any)
```

`from roboto.query import EnumFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L516-L541)

Bases: `_EqualityFilterBase`

Filter on a field whose values come from a fixed set of options, by equality.

Building one raises `pydantic.ValidationError` when `comparator` is an operator the filter does not offer, when `comparator` takes a value and `values` is empty, or when `or_null` is set with a comparator other than the two it allows.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EnumFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Equals, roboto.query.conditions.Comparator.NotEquals, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull]`): Operator the filter applies.
- **EnumFilter.type** (`Literal['enum']`) = `'enum'`: Kind of filter, always `"enum"`.
- **EnumFilter.values** (`list[str]`) = `None`: Options to compare the field with, empty when `comparator` takes none.

### FILTER_VARIANTS

```python
roboto.query.filters.FILTER_VARIANTS: Final[dict[str, type[pydantic.BaseModel]]]
```

`from roboto.query.filters import FILTER_VARIANTS`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L664-L673)

Each filter type's model, keyed by the value of its `type` field.

### Filter

```python
type roboto.query.filters.Filter = typing.Annotated[typing.Union[StringFilter, NumericFilter, MetricFilter, DateFilter, BooleanFilter, SetFilter, EnumFilter, IdentityFilter], pydantic.Field(discriminator='type')]
```

`from roboto.query import Filter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L614-L626)

Filter of any type, told apart by `type`.

One of `StringFilter`, `NumericFilter`, `MetricFilter`, `DateFilter`, `BooleanFilter`, `SetFilter`, `EnumFilter` or `IdentityFilter`.

Each type's `comparator` accepts only the operators the Roboto web app's filter controls offer for that kind of field, which can be fewer than a query accepts for it. Of the [`Comparator`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator) members, a date filter offers `LessThan` but not `LessThanOrEqual`, and a boolean filter offers `Equals` but not `NotEquals`. `comparators_by_type` lists each type's operators.

### FilterMatchMode

```python
class roboto.query.filters.FilterMatchMode
```

`from roboto.query import FilterMatchMode`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L160-L167)

Bases: `roboto.compat.StrEnum`

Match mode of a `SavedFilters`: how its filters combine.

**Attributes**

- **FilterMatchMode.And** = `'AND'`: Every filter must match.
- **FilterMatchMode.Or** = `'OR'`: At least one filter must match.

### FilterOnlyComparator

```python
class roboto.query.filters.FilterOnlyComparator
```

`from roboto.query import FilterOnlyComparator`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L42-L82)

Bases: `roboto.compat.StrEnum`

Operator of a saved filter that [`Comparator`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator) cannot express.

Converting a filter to a query fixes what these operators mean: `Between` becomes two comparisons, and a relative time window becomes a range between two fixed times. The conversion cannot be undone, so `SavedFilters` stores the operator itself. A window converted when a View was saved would match the wrong records from the next day on, with nothing in the stored query to show it.

Every member but `Between` is a time window relative to when the filter runs, and takes no value.

**Attributes**

- **FilterOnlyComparator.Between** = `'BETWEEN'`: Inclusive range from the filter's first value to its second.

  Converts to [`GreaterThanOrEqual`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.GreaterThanOrEqual) on the first and [`LessThanOrEqual`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.LessThanOrEqual) on the second.

- **FilterOnlyComparator.Last24Hours** = `'LAST_24_HOURS'`: Last 24 hours.

- **FilterOnlyComparator.Last30Days** = `'LAST_30_DAYS'`: Last 30 days.

- **FilterOnlyComparator.Last3Hours** = `'LAST_3_HOURS'`: Last 3 hours.

- **FilterOnlyComparator.Last7Days** = `'LAST_7_DAYS'`: Last 7 days.

- **FilterOnlyComparator.Last8Hours** = `'LAST_8_HOURS'`: Last 8 hours.

- **FilterOnlyComparator.Last90Days** = `'LAST_90_DAYS'`: Last 90 days.

- **FilterOnlyComparator.ThisMonth** = `'THIS_MONTH'`: Current month.

- **FilterOnlyComparator.Today** = `'TODAY'`: Current day.

### IDENTITY_OPERATORS_BY_TYPE

```python
roboto.query.filters.IDENTITY_OPERATORS_BY_TYPE: Final[dict[roboto.principal.RobotoPrincipalType, IdentityOperators]]
```

`from roboto.query.filters import IDENTITY_OPERATORS_BY_TYPE`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L127-L137)

Identity operators of each principal type.

Covers every [`RobotoPrincipalType`](/docs/reference/python-sdk/roboto/principal#roboto.principal.RobotoPrincipalType), not only the types that `created_by` values hold, so a filter can match any type of principal.

### IDENTITY_PRESET_COMPARATORS

```python
roboto.query.filters.IDENTITY_PRESET_COMPARATORS: Final[frozenset[IdentityComparator]]
```

`from roboto.query.filters import IDENTITY_PRESET_COMPARATORS`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L154-L156)

Identity operators that take no value: the `IsAny<Type>` operator of each principal type.

### IDENTITY_TYPES_BY_COMPARATOR

```python
roboto.query.filters.IDENTITY_TYPES_BY_COMPARATOR: Final[dict[IdentityComparator, roboto.principal.RobotoPrincipalType]]
```

`from roboto.query.filters import IDENTITY_TYPES_BY_COMPARATOR`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L144-L148)

Principal type each identity operator matches.

Derived from `IDENTITY_OPERATORS_BY_TYPE`.

### IdentityComparator

```python
class roboto.query.filters.IdentityComparator
```

`from roboto.query import IdentityComparator`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L85-L111)

Bases: `roboto.compat.StrEnum`

Operator of an identity filter: which type of principal the field must name.

Fields such as `created_by` hold a principal as `<type>:<id>`, such as `user:<user_id>` or `device:<device_id>@<org_id>`. Because the operator names the type, a filter control can offer principals of that type to pick from. Each [`RobotoPrincipalType`](/docs/reference/python-sdk/roboto/principal#roboto.principal.RobotoPrincipalType) has two members, paired in `IDENTITY_OPERATORS_BY_TYPE`:

- `Is<Type>` takes principals of the type as values and matches any of them.
- `IsAny<Type>` takes no value and matches every principal of the type.

Unlike `FilterOnlyComparator`, both convert to a query without loss: `Is<Type>` to [`Equals`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.Equals) on each value, combined with OR, and `IsAny<Type>` to [`Like`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.Like) with the pattern `<type>:%`.

**Attributes**

- **IdentityComparator.IsAnyDevice** = `'IS_ANY_DEVICE'`
- **IdentityComparator.IsAnyIntegration** = `'IS_ANY_INTEGRATION'`
- **IdentityComparator.IsAnyInvocation** = `'IS_ANY_INVOCATION'`
- **IdentityComparator.IsAnyOrg** = `'IS_ANY_ORG'`
- **IdentityComparator.IsAnyUser** = `'IS_ANY_USER'`
- **IdentityComparator.IsDevice** = `'IS_DEVICE'`
- **IdentityComparator.IsIntegration** = `'IS_INTEGRATION'`
- **IdentityComparator.IsInvocation** = `'IS_INVOCATION'`
- **IdentityComparator.IsOrg** = `'IS_ORG'`
- **IdentityComparator.IsUser** = `'IS_USER'`

### IdentityFilter

```python
class roboto.query.filters.IdentityFilter(/, **data: Any)
```

`from roboto.query import IdentityFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L563-L611)

Bases: `_FilterBase`

Filter on a field that holds a principal, such as `created_by` or `modified_by`, by the principal's type.

The operator, an `IdentityComparator`, names the type, and any values are principals of that type, each stored with the label the picker showed. Offers no [`IsNull`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.IsNull) or `IsNotNull`, because Roboto records a principal in these fields whenever it creates or changes a resource.

Building one raises `pydantic.ValidationError` when `comparator` is not an `IdentityComparator`, when an `Is<Type>` comparator has no values, or when a value is not of the form `<type>:<id>` or names a principal of a type other than the comparator's.

**Parameters**

- **data** (`Any`)

**Attributes**

- **IdentityFilter.comparator** (`Literal[IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator, IdentityComparator]`): Operator the filter applies, which names the principal type to match.
- **IdentityFilter.type** (`Literal['identity']`) = `'identity'`: Kind of filter, always `"identity"`.
- **IdentityFilter.values** (`list[LabeledOption]`) = `None`: Principals to match, with the labels the picker showed; empty for an `IsAny<Type>` comparator.

### IdentityOperators

```python
class roboto.query.filters.IdentityOperators
```

`from roboto.query.filters import IdentityOperators`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L114-L124)

Bases: `NamedTuple`

Pair of identity operators for one principal type.

`IDENTITY_OPERATORS_BY_TYPE` holds one for each type.

**Attributes**

- **IdentityOperators.comparator** (`IdentityComparator`): Operator that matches the principals in a filter's values, `Is<Type>`.
- **IdentityOperators.preset** (`IdentityComparator`): Operator that matches every principal of the type and takes no value, `IsAny<Type>`.

### LabeledOption

```python
class roboto.query.filters.LabeledOption(/, **data: Any)
```

`from roboto.query import LabeledOption`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L544-L560)

Bases: `pydantic.BaseModel`

Option picked for an `IdentityFilter`: the value a query uses and the label shown.

The label is stored because it cannot be recovered when the filter loads. Without it, a value such as `user:<user_id>` would show as itself, or need one lookup per value, which a user opening a shared View may not have permission to make. Only `value` goes into a query.

Carried in `IdentityFilter.values`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **LabeledOption.label** (`str`): Text the picker showed when the author chose the option, never used in a query.
- **LabeledOption.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- **LabeledOption.value** (`str`): Principal the option stands for, as `<type>:<id>`.

### METRIC_FIELD_PATTERN

```python
roboto.query.filters.METRIC_FIELD_PATTERN: Final[str] = '^metric\\..+'
```

`from roboto.query import METRIC_FIELD_PATTERN`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L32-L32)

Regular expression a metric filter's `field` must match.

It matches `METRIC_FIELD_PREFIX` followed by the metric's path.

### METRIC_FIELD_PREFIX

```python
roboto.query.filters.METRIC_FIELD_PREFIX: Final[str] = 'metric.'
```

`from roboto.query import METRIC_FIELD_PREFIX`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L24-L24)

Prefix that marks a field as a user-defined metric rather than a numeric property of the resource.

A `MetricFilter` stores its `field` with the prefix, so the field names the metric the same way [`field`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Condition.field) does, and converting the filter to a query copies it unchanged. No SDK method reads it.

### MetricField

```python
type roboto.query.filters.MetricField = typing.Annotated[str, pydantic.StringConstraints(pattern=METRIC_FIELD_PATTERN)]
```

`from roboto.query.filters import MetricField`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L38-L38)

Field name of a user-defined metric: `metric.` followed by the metric's dot-delimited path.

### MetricFilter

```python
class roboto.query.filters.MetricFilter(/, **data: Any)
```

`from roboto.query import MetricFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L357-L402)

Bases: `_EqualityFilterBase`

Filter on a user-defined metric, by order or equality.

Offers the same operators and values as `NumericFilter`, but `field` names a metric, so a client that loads the filter knows to show its metric picker rather than its property controls. [`IsNull`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.IsNull) matches a resource, such as a session, with no value recorded for the metric.

Building one raises `pydantic.ValidationError` when `field` does not match `METRIC_FIELD_PATTERN`, when `comparator` is an operator the filter does not offer, when `comparator` takes a value and `values` is empty, or when `or_null` is set with a comparator other than the two it allows.

**Parameters**

- **data** (`Any`)

**Attributes**

- **MetricFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Equals, roboto.query.conditions.Comparator.NotEquals, roboto.query.conditions.Comparator.GreaterThan, roboto.query.conditions.Comparator.LessThan, roboto.query.conditions.Comparator.GreaterThanOrEqual, roboto.query.conditions.Comparator.LessThanOrEqual, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull]`): Operator the filter applies.

- **MetricFilter.field** (`MetricField`): Name of the metric: `metric.` followed by its dot-delimited path.

- **MetricFilter.type** (`Literal['metric']`) = `'metric'`: Kind of filter, always `"metric"`.

- **MetricFilter.unit** (`str | None`) = `None`: Unit of the metric, or `None` if the metric's definition declares none.

  Copied from the definition when the filter was built. A client shows it beside the value, as in `path_deviation > 1.5 m`, without fetching the definition. A later change to the definition's unit does not change it.

- **MetricFilter.values** (`list[float]`) = `None`: Values to compare the metric with, empty when `comparator` takes none.

### NumericFilter

```python
class roboto.query.filters.NumericFilter(/, **data: Any)
```

`from roboto.query import NumericFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L325-L354)

Bases: `_EqualityFilterBase`

Filter on a numeric field, by order or equality.

Building one raises `pydantic.ValidationError` when `comparator` is an operator the filter does not offer, when `comparator` takes a value and `values` is empty, or when `or_null` is set with a comparator other than the two it allows.

**Parameters**

- **data** (`Any`)

**Attributes**

- **NumericFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Equals, roboto.query.conditions.Comparator.NotEquals, roboto.query.conditions.Comparator.GreaterThan, roboto.query.conditions.Comparator.LessThan, roboto.query.conditions.Comparator.GreaterThanOrEqual, roboto.query.conditions.Comparator.LessThanOrEqual, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull]`): Operator the filter applies.
- **NumericFilter.type** (`Literal['numeric']`) = `'numeric'`: Kind of filter, always `"numeric"`.
- **NumericFilter.values** (`list[float]`) = `None`: Values to compare the field with, empty when `comparator` takes none.

### PRESENCE_COMPARATORS

```python
roboto.query.filters.PRESENCE_COMPARATORS: Final[frozenset[roboto.query.conditions.Comparator]]
```

`from roboto.query.filters import PRESENCE_COMPARATORS`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L184-L184)

Operators that test whether a field is set, and take no value.

### PRESET_COMPARATORS

```python
roboto.query.filters.PRESET_COMPARATORS: Final[frozenset[FilterOnlyComparator]]
```

`from roboto.query.filters import PRESET_COMPARATORS`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L170-L181)

Relative time windows: the date operators that take no value.

### SavedFilters

```python
class roboto.query.filters.SavedFilters(/, **data: Any)
```

`from roboto.query import SavedFilters`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L639-L661)

Bases: `pydantic.BaseModel`

Filter controls as their author set them: the field, operator and values of each filter, and how they combine.

Records the operator the author chose, such as "the last 7 days", rather than the query it converts to. Converting fixes a relative window's dates and splits a range into two comparisons, and cannot be undone; `FilterOnlyComparator` lists the operators a [`QuerySpecification`](/docs/reference/python-sdk/roboto/query/specification#roboto.query.specification.QuerySpecification) cannot express. Building one raises `pydantic.ValidationError` when a filter's `type` is not a filter type, or when a filter fails its own type's checks.

Carried in [`filters`](/docs/reference/python-sdk/roboto/domain/views/record#roboto.domain.views.record.ViewDefinition.filters).

**Parameters**

- **data** (`Any`)

**Attributes**

- **SavedFilters.filters** (`list[Filter]`) = `None`: Filters, in the order the author added them.

- **SavedFilters.match_mode** (`FilterMatchMode`): How the filters combine: every one must match, or at least one.

  One mode applies to every filter. Unlike a [`ConditionGroup`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.ConditionGroup), saved filters cannot nest, since the filter controls give an author no way to build nested groups.

- **SavedFilters.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### SetFilter

```python
class roboto.query.filters.SetFilter(/, **data: Any)
```

`from roboto.query import SetFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L492-L513)

Bases: `_FilterBase`

Filter on a field that holds a collection, such as tags, by whether the collection contains values.

Offers no [`IsNull`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Comparator.IsNull) or `IsNotNull`. Building one raises `pydantic.ValidationError` when `comparator` is an operator the filter does not offer, or when `values` is empty.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SetFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Contains, roboto.query.conditions.Comparator.NotContains]`): Operator the filter applies.
- **SetFilter.type** (`Literal['set']`) = `'set'`: Kind of filter, always `"set"`.
- **SetFilter.values** (`list[str]`) = `None`: Values to look for in the collection.

### StringFilter

```python
class roboto.query.filters.StringFilter(/, **data: Any)
```

`from roboto.query import StringFilter`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L290-L322)

Bases: `_EqualityFilterBase`

Filter on a text field.

Building one raises `pydantic.ValidationError` when `comparator` is an operator the filter does not offer, when `comparator` takes a value and `values` holds no non-blank string, or when `or_null` is set with a comparator other than the two it allows.

**Parameters**

- **data** (`Any`)

**Attributes**

- **StringFilter.comparator** (`Literal[roboto.query.conditions.Comparator.Equals, roboto.query.conditions.Comparator.NotEquals, roboto.query.conditions.Comparator.Contains, roboto.query.conditions.Comparator.NotContains, roboto.query.conditions.Comparator.Like, roboto.query.conditions.Comparator.NotLike, roboto.query.conditions.Comparator.IsNull, roboto.query.conditions.Comparator.IsNotNull]`): Operator the filter applies.
- **StringFilter.type** (`Literal['string']`) = `'string'`: Kind of filter, always `"string"`.
- **StringFilter.values** (`list[str]`) = `None`: Values to compare the field with, empty when `comparator` takes none.

### comparators_by_type()

```python
def roboto.query.filters.comparators_by_type() -> dict[str, list[str]]
```

`from roboto.query.filters import comparators_by_type`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/query/filters.py#L677-L691)

Return the wire values of the operators each filter type accepts, keyed by the filter's `type`.

Read from the filter models' `comparator` fields, so it lists exactly what they accept. Each list is sorted.

**Usage**

```python
comparators_by_type()["boolean"]
# ['EQUALS', 'IS_NOT_NULL', 'IS_NULL']
```

**Returns**

- `dict[str, list[str]]`
