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

fix: column preview types not accurate #1702

Closed
wants to merge 2 commits into from

Conversation

ethanalvizo
Copy link
Contributor

Closes #1597

@ethanalvizo ethanalvizo requested a review from mofojed December 21, 2023 23:18
@ethanalvizo ethanalvizo self-assigned this Dec 21, 2023
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (a2ef056) 46.65% compared to head (1fce944) 46.67%.
Report is 28 commits behind head on main.

Files Patch % Lines
packages/iris-grid/src/ColumnStatistics.tsx 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1702      +/-   ##
==========================================
+ Coverage   46.65%   46.67%   +0.01%     
==========================================
  Files         593      606      +13     
  Lines       36467    36875     +408     
  Branches     9135     9267     +132     
==========================================
+ Hits        17014    17211     +197     
- Misses      19401    19612     +211     
  Partials       52       52              
Flag Coverage Δ
unit 46.67% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

So there's a problem I didn't realize when assigning this ticket - we don't actually know it's a preview column, the column description is used on non-preview column types as well. For example, on rollup tables:

from deephaven import read_csv, agg

insurance = read_csv("https://media.githubusercontent.com/media/deephaven/examples/main/Insurance/csv/insurance.csv")

agg_list = [agg.avg(cols=["bmi", "expenses"])]
by_list = ["region", "age"]

test_rollup = insurance.rollup(aggs=[], by=by_list, include_constituents=True)
insurance_rollup = insurance.rollup(aggs=agg_list, by=by_list, include_constituents=True)

If you hover over expenses, you'll see there's an actual description:
image

So we don't want to swap the description in that case.

I think we need to push back on this ticket as, and either have a specific field detailing the preview type (rather than stuffing it in the description). Then we can treat it a little more differently (and also disable stuff like filtering, rather than trying to filter it as a string).

Right now the description is getting set in the API for column previews: https://github.com/deephaven/deephaven-core/blob/01b6cf49dad3e855067f0cb411a858c89b875d2d/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java#L121

We have tickets on the Core side for this: deephaven/deephaven-core#3358
and deephaven/deephaven-core#2102
So I don't think we can complete this ticket as desired until addressing those two tickets first.

const description = column.description === null ? null : column.description;
let columnType = column.type.substring(column.type.lastIndexOf('.') + 1);
let description;
if (column.description != null && column.description !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

This check is redundant. != null will mean that !== undefined is always true. You'd only need to strictly check against undefined if you strictly checked against null, e.g. !== null instead of just != null.
When checking against both null and undefined, doing a loose check != null is fine.

@ethanalvizo
Copy link
Contributor Author

Waiting on core tickets mentioned above to go through first

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI calls column types "string" when they have no native arrow js-api implementation
2 participants