Objects

The Deephaven Query Language has native support for objects within query strings.

Example

The following example shows how to create an object and use one of its methods within a query string.

from deephaven import new_table
from deephaven.column import string_col


class MyStringClass:

    def __init__(self, strn):
        self.strn = strn

    def my_string(self):
        return self.strn


obj = MyStringClass("A")

source = new_table([string_col("Strings", ["A", "B", "C"])])

result = source.update(formulas=["Match = Strings_[i] == obj.my_string()"])