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(pivot_table_v2): Pivot table cannot validly group rows and keep ordering #20588

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

comdiv
Copy link

@comdiv comdiv commented Jul 1, 2022

SUMMARY

Fix and improve value_a_z, value_z_a sort order for pivot table

  1. work on any size of cols and rows in pivot table options, groups them
  2. keep subtotals with their groups
  3. keep subtotals on required top/bottom position
  4. switches to a-z order in case of same numerical values

TESTING INSTRUCTIONS

Create any pivot v2 table with

  1. at least two rows (or/and to cols) and summable metric
  2. switch on subtotals
  3. try switch different orderings (all row/col groups should be consistent)
  4. try switch subtotal position (all row/col groups should be consistent and subtotals should be at expected place)

ADDITIONAL INFORMATION

Known issue - not tested for non monotonic summable aggregates with natural order (sum, count, avg).
It's because it collect raw subtotals sumarrizing internal values.
Some aggregate function (min, max for) could have unexpected behavior in sorting.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!

@zhaoyongjie
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

@zhaoyongjie Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

@zhaoyongjie Ephemeral environment creation failed. Please check the Actions logs for details.

@zhaoyongjie zhaoyongjie changed the title (pivot_table_v2) fix #20564 fix(pivot_table_v2): #20564 Jul 4, 2022
@zhaoyongjie zhaoyongjie changed the title fix(pivot_table_v2): #20564 fix(pivot_table_v2): Pivot table cannot validly group rows and keep ordering Jul 4, 2022
@zhaoyongjie
Copy link
Member

@comdiv Thanks for the fixing. It can not work when I populate a column and select value asc by rows.

image

image

@comdiv
Copy link
Author

comdiv commented Jul 4, 2022

As in previous version you should sum whole row, not just 'Abigail' because 'value order' means 'row value order'. Because you cannot express that Abigail column should be sorted while Alicia not. Sum of values used

@rusackas rusackas requested a review from kgabryje July 7, 2022 04:14
@rusackas
Copy link
Member

rusackas commented Feb 1, 2024

closing/reopening to see if this'll pass CI. It also still needs a review, of course.

@rusackas rusackas closed this Feb 1, 2024
@rusackas rusackas reopened this Feb 1, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 47 lines in your changes missing coverage. Please review.

Project coverage is 68.74%. Comparing base (8d4994a) to head (e9d84df).
Report is 4094 commits behind head on master.

Files with missing lines Patch % Lines
...hart-pivot-table/src/react-pivottable/utilities.js 0.00% 47 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20588      +/-   ##
==========================================
+ Coverage   66.85%   68.74%   +1.88%     
==========================================
  Files        1753     1918     +165     
  Lines       65825    84047   +18222     
  Branches     7006    12771    +5765     
==========================================
+ Hits        44010    57781   +13771     
- Misses      20030    23468    +3438     
- Partials     1785     2798    +1013     
Flag Coverage Δ
javascript 59.83% <0.00%> (+7.87%) ⬆️

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.

@rusackas rusackas added the hold:testing! On hold for testing label Feb 2, 2024
@rusackas

This comment was marked as outdated.

1 similar comment
@rusackas
Copy link
Member

rusackas commented Jun 3, 2024

/testenv up

@rusackas rusackas requested a review from justinpark June 3, 2024 18:46
@kgabryje
Copy link
Member

kgabryje commented Jun 8, 2024

/testenv up

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Testenv is not working for some reason, but I tested locally and it's working great! Was not able to break it, code also looks good.

@kgabryje
Copy link
Member

kgabryje commented Jun 9, 2024

@comdiv Would you mind rebasing your PR on the latest master? Maybe that will unblock the CI

@kgabryje
Copy link
Member

kgabryje commented Jun 9, 2024

Also, for the sake of completeness, could you add before/after screenshots or recordings to the description?

@rusackas
Copy link
Member

There are a bunch of CI tasks not running. Let's kick-start it by closing/reopening and see if that gets us through the full list. Then hopefully the ephemeral will work ¯_(ツ)_/¯

@rusackas rusackas closed this Jun 10, 2024
@rusackas rusackas reopened this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants