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

Wrap RingTableTools in Python #3492

Closed
jjbrosnan opened this issue Mar 6, 2023 · 1 comment · Fixed by #3765
Closed

Wrap RingTableTools in Python #3492

jjbrosnan opened this issue Mar 6, 2023 · 1 comment · Fixed by #3765
Assignees
Labels
feature request New feature or request triage

Comments

@jjbrosnan
Copy link
Contributor

Description

io.deephaven.engine.table.impl.sources.ring.RingTableTools is not wrapped in Python. It should be so that Python users can leverage it.

@jjbrosnan jjbrosnan added feature request New feature or request triage labels Mar 6, 2023
@jmao-denver jmao-denver self-assigned this Mar 6, 2023
@supernomad
Copy link
Contributor

fwiw in the mean time if you want to take say a stream table and push it into a ring table you can use this:

import jpy

from deephaven import DHError
from deephaven.table import Table

_JRingTableTools = jpy.get_type("io.deephaven.engine.table.impl.sources.ring.RingTableTools")

def stream_to_ring(table: Table, capacity: int) -> Table:
    try:
        return Table(j_table=_JRingTableTools.of(table.j_table, capacity))
    except Exception as e:
        raise DHError(e, "failed to create a ring table.") from e

as a quick and dirty hack to get this working for testing purposes 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants