tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion¶

Module Contents¶

Classes¶

Class

Description

ColumnFilterCriterion

FilterCriterion

The base class for all filter criteria.

API¶

class ColumnFilterCriterion(
attribute: str | None = None,
init_parameters: Any = None,
)¶

Bases: tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion.FilterCriterion

class FilterCriterion(
init_parameters: Any = None,
)¶

Bases: tlc.core.object.Object

The base class for all filter criteria.

A filter criterion is a predicate that can be applied to a row’s attributes to determine whether the row matches the criterion.

Parameters:
  • url – The URL of the object.

  • created – The creation time of the object.

  • init_parameters – A dictionary containing the initial values of the object’s properties.

filter_matches(
row: Any,
schema: Schema | None,
) bool¶

Determines whether the filter criterion matches the given row.

Parameters:
  • row – The row to test.

  • schema – The schema of the row.

Returns:

True if the row matches the filter criterion, False otherwise.

abstract static from_any(
any_value: Mapping | FilterCriterion,
) FilterCriterion¶
to_minimal_dict(
include_all: bool,
) dict[str, Any]¶

Provide an alternative way of serialization for FilterCriterion.

We don’t have polymorphic schemas on the Table-level so we need a way of making FilterCriteria into a dict, Ref json_helpers.py