filter_rows
Filter data rows using flexible conditions with support for multiple operators, logical combinations, and comprehensive null value handling to extract specific subsets from datasets.
Instructions
Filter rows using flexible conditions: comprehensive null value and text matching support.
Provides powerful filtering capabilities optimized for AI-driven data analysis. Supports multiple operators, logical combinations, and comprehensive null value handling.
Examples: # Numeric filtering filter_rows(ctx, [{"column": "age", "operator": ">", "value": 25}])
# Text filtering with null handling
filter_rows(ctx, [
{"column": "name", "operator": "contains", "value": "Smith"},
{"column": "email", "operator": "is_not_null"}
], mode="and")
# Multiple conditions with OR logic
filter_rows(ctx, [
{"column": "status", "operator": "==", "value": "active"},
{"column": "priority", "operator": "==", "value": "high"}
], mode="or")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conditions | Yes | List of filter conditions with column, operator, and value | |
| mode | No | Logic for combining conditions (and/or) | and |
Input Schema (JSON Schema)
{
"properties": {
"conditions": {
"description": "List of filter conditions with column, operator, and value",
"items": {
"$ref": "#/$defs/FilterCondition"
},
"type": "array"
},
"mode": {
"default": "and",
"description": "Logic for combining conditions (and/or)",
"enum": [
"and",
"or"
],
"type": "string"
}
},
"required": [
"conditions"
],
"type": "object"
}