seismometer.configuration.model.FilterConfig¶
- pydantic model seismometer.configuration.model.FilterConfig¶
A configurable rule for filtering data based on values in a specific column.
Show Entity Relationship Diagram
![digraph "Entity Relationship Diagram created by erdantic" {
graph [fontcolor=gray66,
fontname="Times New Roman,Times,Liberation Serif,serif",
fontsize=9,
nodesep=0.5,
rankdir=LR,
ranksep=1.5
];
node [fontname="Times New Roman,Times,Liberation Serif,serif",
fontsize=14,
label="\N",
shape=plain
];
edge [dir=both];
"seismometer.configuration.model.FilterConfig" [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>FilterConfig</b></td></tr><tr><td>source</td><td port="source">str</td></tr><tr><td>action</td><td port="action">Optional[Literal['include', 'exclude', 'keep_top']]</td></tr><tr><td>count</td><td port="count">Optional[int]</td></tr><tr><td>values</td><td port="values">Optional[list[Union[str, int, list[str], list[int]]]]</td></tr><tr><td>range</td><td port="range">Optional[FilterRange]</td></tr></table>>,
tooltip="seismometer.configuration.model.FilterConfig

A configurable rule for filtering data based on values in a specific column.&#\
xA;"];
"seismometer.configuration.model.FilterRange" [label=<<table border="0" cellborder="1" cellspacing="0"><tr><td port="_root" colspan="2"><b>FilterRange</b></td></tr><tr><td>min</td><td port="min">Optional[Union[int, float]]</td></tr><tr><td>max</td><td port="max">Optional[Union[int, float]]</td></tr></table>>,
tooltip="seismometer.configuration.model.FilterRange

A numeric range filter specifying minimum and/or maximum values.
"];
"seismometer.configuration.model.FilterConfig":range:e -> "seismometer.configuration.model.FilterRange":_root:w [arrowhead=noneteeodot,
arrowtail=nonenone];
}](../../_images/graphviz-85798559fd9c54668acefa3df4ebb45ed7f02f62.png)
Show JSON schema
{ "title": "FilterConfig", "description": "A configurable rule for filtering data based on values in a specific column.", "type": "object", "properties": { "source": { "title": "Source", "type": "string" }, "action": { "anyOf": [ { "enum": [ "include", "exclude", "keep_top" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Action" }, "count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Count" }, "values": { "anyOf": [ { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "integer" }, "type": "array" } ] }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Values" }, "range": { "anyOf": [ { "$ref": "#/$defs/FilterRange" }, { "type": "null" } ], "default": null } }, "$defs": { "FilterRange": { "description": "A numeric range filter specifying minimum and/or maximum values.", "properties": { "min": { "anyOf": [ { "type": "integer" }, { "type": "number" }, { "type": "null" } ], "default": null, "title": "Min" }, "max": { "anyOf": [ { "type": "integer" }, { "type": "number" }, { "type": "null" } ], "default": null, "title": "Max" } }, "title": "FilterRange", "type": "object" } }, "required": [ "source" ] }- Fields:
- Validators:
validate_filter_config»all fields
- field action: Literal['include', 'exclude', 'keep_top'] | None = None¶
The type of filtering to apply.
“include”: keep only rows matching the specified values or range
“exclude”: remove rows matching the specified values or range
“keep_top”: retain only the top count (by default FilterRule.MAXIMUM_NUM_COHORTS) most frequent values
- Validated by:
- field count: int | None = None¶
Number of top values to retain if action is ‘keep_top’. Defaults to FilterRule.MAXIMUM_NUM_COHORTS.
- Validated by:
- field range: FilterRange | None = None¶
A numeric range with min and/or max bounds, by default None. Typically used with numeric columns.
- Validated by:
- field source: str [Required]¶
The name of the column to filter.
- Validated by:
- field values: List[str | int | List[str] | List[int]] | None = None¶
A list of allowed or disallowed values, by default None.
- Validated by:
- validator validate_filter_config » all fields¶
Validates the consistency of filter fields after model is initialized. Ensures appropriate combinations of action, values, and range.
- Return type: