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

Module Contents#

Classes#

Class

Description

FilterCriterion

The base class for all filter criteria.

ColumnFilterCriterion

API#

class tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion.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: tlc.core.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 | tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion.FilterCriterion) tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion.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

class tlc.core.objects.tables.from_table.filtered_table_criteria.filter_criterion.ColumnFilterCriterion(attribute: str | None = None, init_parameters: Any = None)#

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