def filter_bool ( n : Node , query : str ) -> bool : return _scalariter2item ( n , query , bool )
python filter function return a series, but expected a scalar bool
Filter and ensure that the returned value is of type bool .
def filter_bool(n: Node, query: str) -> bool:
    """
    Filter and ensure that the returned value is of type bool.
    """
    return _scalariter2item(n, query, bool)