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

dh.ui data hook sentinel defaults are confusing #888

Open
mattrunyon opened this issue Sep 16, 2024 · 0 comments
Open

dh.ui data hook sentinel defaults are confusing #888

mattrunyon opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mattrunyon
Copy link
Collaborator

Right now, we set empty tuples as the sentinel value for data hooks when it's a ticking table that is empty. This is not user friendly because the hook will return different data structures based on if there's data in the table or not.

Here's an example where we start w/ an empty tuple, then add data, then remove all data and are back to an empty tuple.

from deephaven import time_table, ui

_t = time_table("PT1S").update("X=ii").tail(5).where("X > 3 && X < 7")

@ui.component
def my_comp(t):
    data = ui.use_table_data(t)
    print(data)
    return t

t = my_comp(_t)

I recall there being some reason we wanted a sentinel value in these cases, but don't remember why. If we are sure we still need/want it then we should strongly consider changing the default to match the structure of the expected output. Changing the sentinel feels like an advanced feature and I'm not sure most people will care about it. They just want a consistent data structure for their data.

@mattrunyon mattrunyon added enhancement New feature or request triage labels Sep 16, 2024
@vbabich vbabich added this to the October 2024 milestone Sep 18, 2024
@vbabich vbabich removed the triage label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants