    def filter(self, input_schema, output_schema, filter_columns, fn, config=None) -> 'Pipeline':
        """
        Filter the input columns based on the selected filter_columns.

        Args:
            input_schema (tuple): The input column/s before filter.
            output_schema (tuple): The output columns after filter, so the length of input_schema equals to the output_schema.
            filter_columns (str | tuple): Which columns to filter on.
            fn (Operation | lambda | callable): The action to perform on the filter_colums.
            config (dict, optional): Config for the filter. Defaults to None.

        Returns:
            Pipeline: Pipeline with filter action added.

        Examples:
            >>> from towhee import pipe
            >>> def filter_func(num):
            ...     return num > 10
            >>> p = (pipe.input('a', 'c')
            ...         .filter('c', 'd', 'a', filter_func)
            ...         .output('d'))
            >>> p(1, 12).get()
            None
            >>> p(11, 12).get()
            [12]
        """
        output_schema = self._check_schema(output_schema)
        input_schema = self._check_schema(input_schema)
        filter_columns = self._check_schema(filter_columns)

        uid = uuid.uuid4().hex
        fn_action = self._to_action(fn)
        dag_dict = deepcopy(self._dag)
        dag_dict[uid] = {
            'inputs': input_schema,
            'outputs': output_schema,
            'op_info': fn_action.serialize(),
            'iter_info': {
                'type': FilterConst.name,
                'param': {FilterConst.param.filter_by: filter_columns}
            },
            'config': config,
            'next_nodes': [],
        }
        dag_dict[self._clo_node]['next_nodes'].append(uid)
        return Pipeline(dag_dict, uid)
Filter the input columns based on the selected filter_columns.

Args:
input_schema (tuple): The input column/s before filter.
output_schema (tuple): The output columns after filter, so the length of input_schema equals to the output_schema.
filter_columns (str | tuple): Which columns to filter on.
fn (Operation | lambda | callable): The action to perform on the filter_colums.
config (dict, optional): Config for the filter. Defaults to None.

Returns:
Pipeline: Pipeline with filter action added.

Examples:
>>> from towhee import pipe
>>> def filter_func(num):
...     return num > 10
>>> p = (pipe.input('a', 'c')
...         .filter('c', 'd', 'a', filter_func)
...         .output('d'))
>>> p(1, 12).get()
None
>>> p(11, 12).get()
[12]
towhee/runtime/pipeline.py