-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use shared ticket format to share an export ticket between clients #38
Comments
This may depend also on a python wrapper on the server side and pydeephaven side. |
We may need to consider also if there is a way to get a callback into the python side; a way for the JS client to let the python side that it has successfully exported the shared token (in the python client can then release its own export if desired). |
Here is the pydeephaven issue, deephaven/deephaven-core#5372 |
Should be able to use this with plots and widgets as well. May need deephaven/deephaven-core#5666 |
@niloc132 how do we use this ticket from the JS API side? |
Needs deephaven/deephaven-core#5666 to be completed so that we can use this from the JS API. |
deephaven/deephaven-core#5854 is ready for review from the JS API side. |
Even with the JS API, there are still some open problems @mofojed and I am unsure how to proceed
|
To recap what we want (I think), in the case where we are running script session server w/ Jupyter: # some server side table we create into a global scope
my_table = ...
# some server side table that is only reachable through ref to DeephavenWidget
DeephavenWidget(my_table.view(["SomeNewColumn=..."])) In this case, we want some way to ensure that the reference to the derivative table is kept alive (I'm assuming we hand off that responsibility to jupyter JS side, although I don't know the specific python mechanism that will keep it alive; maybe cc @niloc132, @rcaudy, @nbauernfeind, we may need some concept of creating a shared ticket from a server-local object, or some other means of accomplishing this? (It's interesting to think about SessionState as a means of accomplishing server-side scoping in a more general fashion.) |
@devinrsmith after a quick call with joe, I think this is much easier - if you're running server side code, you're doing so via the grpc That said, this doesn't belong in this ticket at all - we already have a functional (if entirely unsatisfying) way of getting tables and objects from a server-side jupyter session to a client, and the ticket is aimed at getting objects from a client-side jupyter session to another client. |
I'm having a tough time wrapping my head around how I can use deephaven/deephaven-core#5854, I think because I'm not terribly experienced with the JS API. It seems like we need the actual logic to use that PR to pull within |
In the case of executing a jupyter notebook, it's more like you are running in an interactive session with the jupyter kernel, and not through ExecuteCommand. Similarly, you could imaging getting rid of the jupyter abstraction and running via directly via python: from deephaven_server import Server
server = Server()
server.start()
def my_func():
my_table = ...
my_shareable_ticket = some_func(my_table)
print(my_shareable_ticket)
block()
my_func() Of course, when you have something pre-defined like this, maybe application mode (and application scoped tickets) is really what we want; but I don't know if something like application mode makes sense for interactive jupyter notebook cells. |
From @niloc132 above:
@niloc132, do you have any details on how to create an export ticket from the server side code? We'd want that ticket to be alive for the life of the
We should also be cleaning up that object after the DeephavenWidget is deleted (Jupyter keeps it around while it is being displayed in an output cell).
|
We aren't going to be able to solve for that case right now afaik, see some of my earlier comments. I think we'll only be able to cleanly solve the deephaven-ipywidgets/deephaven_ipywidgets/deephaven.py Lines 140 to 145 in 270e598
|
Currently, this integration relies on setting a random variable name in the global scope so that it can be passed to the JS client:
With the introduction of deephaven/deephaven-core#5340, there should be a much cleaner mechanism to share exports between clients.
The text was updated successfully, but these errors were encountered: