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

Column grouping layout hints are ignored on rollup tables #2035

Closed
mofojed opened this issue May 28, 2024 · 1 comment · Fixed by #2041 or #2050
Closed

Column grouping layout hints are ignored on rollup tables #2035

mofojed opened this issue May 28, 2024 · 1 comment · Fixed by #2041 or #2050
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented May 28, 2024

A customer noticed that column groupings from layout hints are respected on regular tables, but ignored on rollup tables. (The columns can be grouped manually afterward and it works; the issue is just the layout hints being ignored.)

DH-17076

Only reproducible in Groovy:

import io.deephaven.engine.util.LayoutHintBuilder

source = emptyTable(100).update(
    "K1 = ii",
    "K2 = K1 % 10",
    "Y = randomDouble(0, 10)",
    "Z = randomDouble(0, 10)",
)

result_norollup = source.setLayoutHints(LayoutHintBuilder.get().columnGroup("MyCols", ["Y", "Z"]).build())

import io.deephaven.api.agg.spec.AggSpec
import io.deephaven.api.agg.Aggregation


result_rollup = source
    .rollup([Aggregation.of(AggSpec.avg(), "Y", "Z")], false, "K2")
    .setLayoutHints(LayoutHintBuilder.get().columnGroup("MyCols", ["Y", "Z"]).build())

For some reason, layout_hints is not an available method on RollupTable in Python: https://github.com/deephaven/deephaven-core/blob/dbf2b2db31ac3e982fc6c432b66d3cb688fda431/py/server/deephaven/table.py#L169

@mofojed mofojed added bug Something isn't working triage Issue requires triage and removed triage Issue requires triage labels May 28, 2024
@mofojed mofojed modified the milestones: June 2024, Backlog, May 2024 May 28, 2024
@mofojed
Copy link
Member Author

mofojed commented May 29, 2024

Tried to translate the snippet to Core python:

from deephaven import empty_table, agg
source = empty_table(100).update(["K1 = ii", "K2=K1%10", "Y=randomDouble(0, 10)", "Z=randomDouble(0, 10)"])
result_norollup = source.layout_hints(column_groups=[{"name": "MyCols", "children": ["Y", "Z"]}])
result_rollup = source.rollup([agg.avg(["Y", "Z"])], "K2", False).layout_hints(column_groups=[{"name": "MyCols", "children": ["Y", "Z"]}])

However get an error because layout_hints is not a method on RollupTable. In Legacy, it appears HierarchicalTable extends QueryTable which extends BaseTable which has the layoutHints method, but in Core that's not the case.

So I don't think this can actually be reproduced in Core Python...

EDIT: It looks like HierarchicalTable extends GridAttributes, which does have the setLayoutHints method. It's just not accessible from Python, so this is reproducible from Groovy still. Not sure why not exposed in Python.

mofojed added a commit to mofojed/web-client-ui that referenced this issue May 29, 2024
- Related to DH-17076
- Needed a Core patch: deephaven/deephaven-core#5543
- Tested using both the Python and Groovy snippets from the ticket
- Fixes deephaven#2035
mofojed added a commit that referenced this issue Jun 3, 2024
- Related to DH-17076
- Needed a Core patch:
deephaven/deephaven-core#5555
- Tested using both the Groovy snippet from the ticket
- Fixes #2035
mofojed added a commit to mofojed/web-client-ui that referenced this issue Jun 3, 2024
…aven#2041)

- Related to DH-17076
- Needed a Core patch:
deephaven/deephaven-core#5555
- Tested using both the Groovy snippet from the ticket
- Fixes deephaven#2035
mofojed added a commit that referenced this issue Jun 3, 2024
#2050)

- Related to DH-17076
- Needed a Core patch:
deephaven/deephaven-core#5555
- Tested using both the Groovy snippet from the ticket
- Fixes #2035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant