snowflake.snowpark.DataFrameAIFunctions.filter¶
- DataFrameAIFunctions.filter(predicate: str, input_columns: ~typing.Union[~typing.List[~snowflake.snowpark.column.Column], ~typing.Dict[str, ~snowflake.snowpark.column.Column]], *) snowflake.snowpark.DataFrame[source]¶
Filter rows using AI-powered boolean classification.
This method applies AI-based filtering to each row, classifying them as True or False based on the provided predicate. Supports both text-based filtering and image filtering.
- Parameters:
predicate – The classification instruction string. Use placeholders like
{name}when passing a dict of columns, or{0},{1}when passing a list. For file-based filtering, this should contain instructions to classify the file as TRUE or FALSE.input_columns – Optional list of Columns (positional placeholders
{0},{1}, …) or a dict mapping placeholder names to Columns. Used when predicate contains placeholders.
Examples:
This function or method is experimental since 1.39.0.