You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Deephaven as a Python library, the deephaven module can only be safely imported after the deephaven_server.Server has been started. A check needs to be added to deephaven/__init__.py to ensure the server has been started.
The bug was introduced in v0.16. In versions before v0.16, the server needed to be created (to create the JVM), but the server did not need to be started. Changes related to Python variable scoping in the query language introduced the new requirement that the server be started.
The text was updated successfully, but these errors were encountered:
>>> import deephaven_server
>>> server = deephaven_server.Server()
# Starting io.deephaven.python.server.EmbeddedServer
# Bootstrapping from resource '/bootstrap.properties'
# io.deephaven.internal.log.LoggerFactoryServiceLoaderImpl: searching for 'io.deephaven.internal.log.LoggerFactory'...
# io.deephaven.internal.log.LoggerFactoryServiceLoaderImpl: found 'io.deephaven.internal.log.LoggerFactorySlf4j'
>>> import deephaven
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/devin/.venvs/deephaven-server-0-16-1/lib64/python3.10/site-packages/deephaven/__init__.py", line 19, in <module>
from .table import SortDirection, AsOfMatchRule
File "/home/devin/.venvs/deephaven-server-0-16-1/lib64/python3.10/site-packages/deephaven/table.py", line 54, in <module>
_j_script_session = jpy.cast(_JExecutionContext.getContext().getQueryScope(), _JUnsynchronizedScriptSessionQueryScope).scriptSession()
AttributeError: 'NoneType' object has no attribute 'scriptSession'
>>> server.start()
Server started on port 10000
>>> import deephaven
>>>
I think ultimately, this is due to the introduction of java execution at python module initialization time, something we haven't done before (up until now, we have mainly just used jpy.get_type, or accessing constant values). I've got a fix I'll get up for review soon.
devinrsmith
added a commit
to devinrsmith/deephaven-core
that referenced
this issue
Sep 19, 2022
When using Deephaven as a Python library, the
deephaven
module can only be safely imported after thedeephaven_server.Server
has been started. A check needs to be added todeephaven/__init__.py
to ensure the server has been started.The bug was introduced in
v0.16
. In versions beforev0.16
, the server needed to be created (to create the JVM), but the server did not need to be started. Changes related to Python variable scoping in the query language introduced the new requirement that the server be started.The text was updated successfully, but these errors were encountered: