Skip to content

Not filter

NotFilter #

NotFilter(filter: RapidataFilter)

Bases: RapidataFilter

A filter that negates another filter's condition. This class implements a logical NOT operation on a given filter, inverting its results.

Parameters:

Name Type Description Default
filter RapidataFilter

The filter whose condition should be negated.

required
Example
from rapidata import NotFilter, LanguageFilter

NotFilter(LanguageFilter(["en"])) 

This will limit the order to be shown to only people who have their phone set to a language other than English.

Source code in src/rapidata/rapidata_client/filter/not_filter.py
def __init__(self, filter: RapidataFilter):
    if not isinstance(filter, RapidataFilter):
        raise ValueError("Filter must be a RapidataFilter object")

    self.filter = filter