deephaven.filters

This module implement various filters that can be used in deephaven table’s filter operations.

class Filter(j_filter)[source]

Bases: JObjectWrapper

A Filter object represents a filter that can be used in Table’s filtering(where) operations.

classmethod from_(conditions)[source]

Creates filter(s) from the given condition(s).

Parameters:

conditions (Union[str, List[str]]) – filter condition(s)

Return type:

Union[Filter, List[Filter]]

Returns:

filter(s)

Raises:

DHError

j_object_type

alias of Filter

not_()[source]

Creates a new filter that evaluates to the opposite of what this filter evaluates to.

Returns:

a new not Filter

class PatternMode(value)[source]

Bases: Enum

The regex mode to use

FIND = io.deephaven.api.filter.FilterPattern$Mode(objectRef=0x5569d966d60a)

Matches any subsequence of the input against the pattern

MATCHES = io.deephaven.api.filter.FilterPattern$Mode(objectRef=0x5569d966d612)

Matches the entire input against the pattern

and_(filters)[source]

Creates a new filter that evaluates to true when all of the given filters evaluates to true.

Parameters:

filters (Union[str, Filter, Sequence[str], Sequence[Filter]]) – the component filters

Return type:

Filter

Returns:

a new and Filter

is_not_null(col)[source]

Creates a new filter that evaluates to true when the col is not null, and evaluates to false when col is null.

Parameters:

col (str) – the column name

Return type:

Filter

Returns:

a new is-not-null Filter

is_null(col)[source]

Creates a new filter that evaluates to true when the col is null, and evaluates to false when col is not null.

Parameters:

col (str) – the column name

Return type:

Filter

Returns:

a new is-null Filter

not_(filter_)[source]

Creates a new filter that evaluates to the opposite of what filter_ evaluates to.

Parameters:

filter (Filter) – the filter to negate with

Return type:

Filter

Returns:

a new not Filter

or_(filters)[source]

Creates a new filter that evaluates to true when any of the given filters evaluates to true.

Parameters:

filters (Union[str, Filter, Sequence[str], Sequence[Filter]]) – the component filter(s)

Return type:

Filter

Returns:

a new or Filter

pattern(mode, col, regex, invert_pattern=False)[source]

Creates a regular-expression pattern filter.

See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html for documentation on the regex pattern.

This filter will never match null values.

Parameters:
  • mode (PatternMode) – the mode

  • col (str) – the column name

  • regex (str) – the regex pattern

  • invert_pattern (bool) – if the pattern matching logic should be inverted

Return type:

Filter

Returns:

a new pattern filter

Raises:

DHError