Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyclient groovy support #2107

Merged
merged 4 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyclient/pydeephaven/_console_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def start_console(self):
try:
result_id = self.session.make_ticket()
response = self._grpc_console_stub.StartConsole(
console_pb2.StartConsoleRequest(result_id=result_id, session_type='python'),
console_pb2.StartConsoleRequest(result_id=result_id, session_type=self.session._session_type),
metadata=self.session.grpc_metadata)
self.console_id = response.result_id
except Exception as e:
Expand Down
4 changes: 3 additions & 1 deletion pyclient/pydeephaven/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ class Session:
is_alive (bool): check if the session is still alive (may refresh the session)
"""

def __init__(self, host: str = None, port: int = None, never_timeout: bool = True):
def __init__(self, host: str = None, port: int = None, never_timeout: bool = True, session_type: str = 'python'):
""" Initialize a Session object that connects to the Deephaven server

Args:
host (str): the host name or IP address of the remote machine, default is 'localhost'
port (int): the port number that Deephaven server is listening on, default is 10000
never_timeout (bool, optional): never allow the session to timeout, default is True
session_type (str, optional): the Deephaven session type. Defaults to 'python'

Raises:
DHError
Expand Down Expand Up @@ -67,6 +68,7 @@ def __init__(self, host: str = None, port: int = None, never_timeout: bool = Tru
self._tables = {}
self._never_timeout = never_timeout
self._keep_alive_timer = None
self._session_type = session_type

self._connect()

Expand Down