deephaven.filters

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

class Filter(j_filter)[source]

Bases: ConcurrencyControl[Filter], JObjectWrapper

A Filter object represents a filter that can be used in Table’s filtering(where) operations. Explicit concurrency and ordering control can be specified on a Filter to affects the parallelization of its evaluation during Table filtering operation.

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

with_declared_barriers(barriers)[source]

Returns a new Filter with the given declared barriers.

Parameters:

barriers (Union[Barrier, Sequence[Barrier]]) – the barrier(s) to declare

Return type:

Filter

Returns:

a new Filter with the given declared barriers

Raises:

DHError

with_respected_barriers(barriers)[source]

Returns a new Filter with the given respected barriers.

Parameters:

barriers (Union[Barrier, Sequence[Barrier]]) – the barrier(s) to respect

Return type:

Filter

Returns:

a new Filter with the given respected barriers

Raises:

DHError

with_serial()[source]

Returns a new Filter with serial evaluation enforced.

Return type:

Filter

Returns:

a new Filter with serial evaluation enforced

Raises:

DHError

class PatternMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

The regex mode to use

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

Matches any subsequence of the input against the pattern

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

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