deephaven_enterprise.input_tables

This module supports the creation of input tables in Deephaven by providing classes for defining columns and input table specifications.

class ColumnSpec(name, data_type, is_key, enum_values=None)[source]

Bases: object

A ColumnSpec defines a column of an input table.

Creates a ColumnSpec with the provided name, data type, and key status.

Parameters:
  • name (str) – the name of the column

  • data_type (DType) – the data type of the column

  • is_key (bool) – whether the column is a keyed column

  • enum_values (list[Any]) – the enum values for the column, defaults to None

Raises:

DHError

data_type()[source]

Returns the DType of the column.

Returns:

the DType of the column

Return type:

DType

enum_values()[source]

Gets the enum values for the column.

Return type:

list[Any]

Returns:

list[Any]

is_key()[source]

Whether the column is a keyed column.

Return type:

bool

Returns:

bool

name()[source]

Returns the name of the column.

Return type:

str

Returns:

str

class InputTableSpec(column_specs)[source]

Bases: object

A specification for input tables that can be passed into database.Database.add_input_table_schema() to add an input table schema to the database.

See https://deephaven.io/enterprise/docs/coreplus/user-tables/#input-tables-1 for more information.

Creates an InputTableSpec with the provided ColumnSpecs.

Parameters:

column_specs (list[ColumnSpec]) – the column specs to create the InputTableSpec

add_column_specs(column_specs)[source]

Returns a new InputTableSpec that is equal to this one, except with the specified additional ColumnSpecs.

Parameters:

column_specs (list[ColumnSpec]) – specified ColumnSpecs to add to the InputTableSpec

Return type:

InputTableSpec

Returns:

a new InputTableSpec

column_specs()[source]

Returns the ColumnSpecs for this input table.

Returns:

the ColumnSpecs for this input table

Return type:

dict[str, ColumnSpec]

static get_column_specs_from_j_input_table_spec(j_input_table_spec)[source]

Extracts Java column specs from Java input table specs and returns them as Python ColumnSpecs.

Parameters:

j_input_table_spec (jpy.JType) – Java input table spec to extract column specs from

Returns:

Python ColumnSpecs from the Java input table spec

Return type:

dict[str, ColumnSpec]

remove_column_specs(column_names)[source]

Returns an InputTableSpec that is equal to this one, except without the specified columns.

Parameters:

column_names (list[str]) – specified columns to exclude from the returned InputTableSpec

Return type:

InputTableSpec

Returns:

a new InputTableSpec