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
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: