General Usage Filters

Apply filters using column references

You may apply filters using column references.

OperatorDescriptionExample
and_()Creates an AND SQL conditionand_(table.a > 23, table.b == u’blue’)
or_()Creates an OR SQL conditionor_(table.a > 23, table.b == u’blue’)
not_()Inverts the conditionnot_(and_(table.a > 23, table.b == u’blue’))
in_()Test if values are with a tuple of valuestable.column.in_((1, 2, 3))
notinInverts the IN conditiontable.column.notin((1, 2, 3))
any_()Applies the SQL ANY() condition to a columntable.column.any((‘red’, ‘blue’, ‘yellow’))
betweenApplies the SQL BETWEEN conditiontable.column.between(23, 46)
startswithApplies the SQL LIKE ‘%’table.column.startswith(‘abc’)
containsApplies the SQL LIKE ‘%%’table.column.contains(‘mno’)
endswithApplies the SQL LIKE ‘%%’table.column.endswith(‘xyz’)
is_Applies the SQL is the IS for things like IS NULLtable.column.is_(None)
isnotApplies the SQL is the IS for things like IS NOT NULLtable.column.isnot(None)
likeApplies the SQL LIKE methodtable.column.like(‘%foobar%’’)
notlikeApplies the SQL NOT LIKE methodtable.column.notlike(‘%foobar%’)
ilikeApplies the SQL ILIKE methodtable.column.ilike(‘%foobar%’)
notilikeApplies the SQL NOT ILIKE methodtable.column.notilike(‘%foobar%’)
NULL, Null, nullAlias for Python None
TRUE, trueAlias for Python True
FALSE, falseAlias for Python False
>Greater Thantable.column > 23
<Less Thantable.column < 23
>=Greater than or equal totable.column >= 23
<=Less than or equal totable.column <= 23
==Equal totable.column == 23 table.column == ‘blue’
!=Not Equal totable.column != 23 table.column != ‘blue’
Last modified November 27, 2023 at 12:56 PM EST: Restructured the file structure/a few changes (f6c58b8)