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

feat: Use shared ticket for pydeephaven tables #49

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion deephaven_ipywidgets/deephaven.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,17 @@ def __init__(self, deephaven_object, height=600, width=0, session=None):
server_url, token = _check_session(session, params)

elif _str_object_type(deephaven_object) == "pydeephaven.table.Table":
from pydeephaven.session import SharedTicket
session = deephaven_object.session

server_url, token = _check_session(session, params)

session.bind_table(object_id, deephaven_object)
# h/ is the prefix for shared tickets used by the server
ticket = SharedTicket(b"h/" + object_id.encode("utf-8"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this magic h/ in front?

Also - does this still only work with tables? We can't publish other kinds of tickets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure myself, I saw you made this comment deephaven/deephaven-core#5854 (comment) so I included it

Copy link
Collaborator Author

@jnumainville jnumainville Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this doesn't work for other tickets at this time. I think that requires some other mechanism that we either don't have or is tricky to do. I tried using publish (see implementation of publish_table) but it requires a ticket to already be attached to the object. I didn't really investigate beyond that because it seems like something that requires more careful thought. There is some discussion on #38 for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added comment

session.publish_table(ticket, deephaven_object)

params["type"] = "Table"
params["isShared"] = "true"
else:
from deephaven_server import Server
port = Server.instance.port
Expand Down
Loading