filter_rows
Filter data rows using flexible conditions with support for null values, text matching, and logical combinations 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 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether operation completed successfully | |
| rows_after | Yes | Row count after filtering | |
| rows_before | Yes | Row count before filtering | |
| rows_filtered | Yes | Number of rows removed by filter | |
| conditions_applied | Yes | Number of filter conditions applied |