pydeephaven.session#
- class Session(host=None, port=None, never_timeout=True, session_type='python')[source]#
Bases:
object
A Session object represents a connection to the Deephaven data server. It contains a number of convenience methods for asking the server to create tables, import Arrow data into tables, merge tables, run Python scripts, and execute queries.
Session objects can be used in Python with statement so that whatever happens in the with statement block, they are guaranteed to be closed upon exit.
- tables#
names of the global tables available in the server after running scripts
- Type:
list[str]
- is_alive#
check if the session is still alive (may refresh the session)
- Type:
bool
- bind_table(name, table)[source]#
Bind a table to the given name on the server so that it can be referenced by that name.
- close()[source]#
Close the Session object if it hasn’t timed out already.
- Raises:
DHError –
- Return type:
None
- import_table(data)[source]#
Import the pyarrow table as a new Deephaven table on the server.
Deephaven supports most of the Arrow data types. However, if the pyarrow table contains any field with a data type not supported by Deephaven, the import operation will fail.
- query(table)[source]#
Create a Query object to define a sequence of operations on a Deephaven table.
- run_script(script)[source]#
Run the supplied Python script on the server.
- Parameters:
script (str) – the Python script code
- Raises:
DHError –
- Return type:
None