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

No way for UI to specify skipping a column in aggregations #4182

Closed
mofojed opened this issue Jul 13, 2023 · 1 comment · Fixed by #4780
Closed

No way for UI to specify skipping a column in aggregations #4182

mofojed opened this issue Jul 13, 2023 · 1 comment · Fixed by #4780
Assignees
Labels
bug Something isn't working core Core development tasks jsapi
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Jul 13, 2023

Related to Web UI issue: deephaven/web-client-ui#1355

UI is unable to specify columns to ignore in aggregations, as the default operation is Sum, and Skip was removed.

Steps to Reproduce:

  1. Open up http://localhost:10000/jsapi/rollup.html, and set a breakpoint in the displayTableDetails function at the top using the developer tools.
  2. Refresh the page. When the breakpoint is hit, highlight the table variable and assign it to a global variable, then resume operation
  3. In the developer console, execute the following snippet:
// `temp1` should be the name of your global variable the table is assigned to
var totalsTable = await temp1.getTotalsTable({ operationMap: { I: ['Sum', 'Count'] } })
console.log('totals columns: ', totalsTable.columns.map(c => c.name))

Expected Results:
3. Only two columns I__Sum and I__Count should exist in the output, since aggregations were only specified for I

Actual Results:
3. There are three columns, ['I__Sum', 'K', 'I__Count']. K should not be in the totals output as the column was not specified

There is no Skip operation that can be used either, so there does not appear to be a way to not aggregate a specific column.

@niloc132
Copy link
Member

niloc132 commented Nov 6, 2023

There is a bug here, but the sample is wrong too - if not set, TotalsTableConfig.defaultOperation defaults to dh.AggregationOperation.SUM.

Corrected:

 // `temp1` should be the name of your global variable the table is assigned to
var totalsTable = await temp1.getTotalsTable({ operationMap: { I: ['Sum', 'Count'] } , defaultOperation: 'Skip'})
console.log('totals columns: ', totalsTable.columns.map(c => c.name)) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Core development tasks jsapi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants