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 the rollup and tree Table operations #3259

Merged
merged 4 commits into from
Jan 7, 2023

Conversation

jmao-denver
Copy link
Contributor

@jmao-denver jmao-denver commented Jan 4, 2023

The new RollupTable and TreeTable classes are very hollow right now in that no further operations are supported on them. However they abide by the JObjectWrapper protocol and should be easily made visible through DHC's gRPC API in the WebUI.

Partial #3249

@jmao-denver jmao-denver added this to the Dec 2022 milestone Jan 4, 2023
@jmao-denver jmao-denver requested review from chipkent and rcaudy January 4, 2023 20:23
@jmao-denver jmao-denver self-assigned this Jan 4, 2023
@jmao-denver jmao-denver requested a review from niloc132 January 4, 2023 20:29
@jmao-denver jmao-denver marked this pull request as ready for review January 4, 2023 20:29
py/server/deephaven/table.py Outdated Show resolved Hide resolved
py/server/deephaven/table.py Outdated Show resolved Hide resolved
py/server/deephaven/table.py Outdated Show resolved Hide resolved
@jmao-denver jmao-denver requested a review from rcaudy January 5, 2023 00:59
rcaudy
rcaudy previously approved these changes Jan 5, 2023
@@ -214,6 +218,42 @@ def _td_to_columns(table_definition):
return cols


class RollupTable(JObjectWrapper):
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this should have some methods to be useful for something beyond the GUI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but that effort is quite substantial and that's why this PR only partially addresses the ticket.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. That can be a January deliverable, instead of a December one.

Copy link
Member

Choose a reason for hiding this comment

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

Create a separate ticket and item in the planning doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ticket will stay open as this PR only partially fixes it.

py/server/deephaven/table.py Outdated Show resolved Hide resolved
py/server/deephaven/table.py Outdated Show resolved Hide resolved
Comment on lines +232 to +233
def __init__(self, j_rollup_table: jpy.JType, aggs: Sequence[Aggregation], include_constituents: bool,
by: Sequence[str]):
Copy link
Member

Choose a reason for hiding this comment

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

This constructor takes a rollup table and arguments that are contained in the rollup table.

  1. It is possible that the rollup table and the args get out of sync, which is bad.
  2. If users would ever touch this, we would just want them to provide the rollup table as an arg, so that we know everything is consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I assume the args are just static properties on the RollupTable, not sure how they would change out of sync, @rcaudy ?
  2. That's quite unlikely as they are for visualization only.

Copy link
Member

Choose a reason for hiding this comment

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

They are immutable properties of the RollupTable. This is safe.

Copy link
Member

Choose a reason for hiding this comment

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

I'm just saying that what is here has the potential of being brittle -- not that it isn't correct.

def j_object(self) -> jpy.JType:
return self.j_tree_table

def __init__(self, j_tree_table: jpy.JType, id_col: str, parent_col: str):
Copy link
Member

Choose a reason for hiding this comment

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

Same comments as the rollup table constructor.

Copy link
Member

Choose a reason for hiding this comment

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

Same as in #3259 (comment)

Comment on lines +1712 to +1713
Note some aggregations can not be used in creating a rollup tables, these include: group, partition, median,
pct, weighted_avg
Copy link
Member

Choose a reason for hiding this comment

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

What makes each of these aggs not work? (e.g. median, pct, and weighed_avg)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rcaudy Maybe you can explain?

Copy link
Member

@rcaudy rcaudy Jan 6, 2023

Choose a reason for hiding this comment

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

We don't have the code to re-aggregate them, or in some cases a model for how it should work. This is a server-side functionality gap that is many years old and won't be addressed under the current tickets.

Copy link
Member

Choose a reason for hiding this comment

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

Should we then have a note that is less specific, with the hope that these things do get fixed? Then we don't have to remember that these notes need to be updated.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure. This is Python specific messaging; the Java code has its own, right down in the authoritative code.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure. This is Python specific messaging; the Java code has its own, right down in the authoritative code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am OK with leaving it as is because the individual failure tests will catch the change if we do get these fixed in the future.

py/server/tests/test_table.py Outdated Show resolved Hide resolved
@jmao-denver jmao-denver requested review from chipkent and rcaudy January 6, 2023 21:31
Copy link
Member

@chipkent chipkent left a comment

Choose a reason for hiding this comment

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

Approved, but my comments to existing conversations should be considered before merging.

@jmao-denver jmao-denver merged commit 67a04f2 into deephaven:main Jan 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2023
@deephaven-internal
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants