superset icon indicating copy to clipboard operation
superset copied to clipboard

fix: the legend does not preserves the order of metrics

Open M1s4k1 opened this issue 3 years ago • 5 comments

SUMMARY

fix https://github.com/apache/superset/issues/22162 Pandas pivot_table modifies the order of columns. Reorder the table columns to preserve the legend order

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

WX20221118-151319 WX20221118-151838

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
  • [ ] Migration is atomic, supports rollback & is backwards-compatible
  • [ ] Confirm DB migration upgrade and downgrade tested
  • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

M1s4k1 avatar Nov 18 '22 08:11 M1s4k1

我认为此更改没有意义,因为在这些更改之后,无法手动重新排序指标。

有什么设置可以使legend的顺序与metrics的顺序相同么? 文档中没有找到. 折线图里调整metrics之后,legend就会被按照字母顺序排列.(我并不熟练,只是目前需要去维护于此相关的项目)

M1s4k1 avatar Nov 18 '22 08:11 M1s4k1

手动调整顺序, 即metrics control里面的metrics可以手动调整顺序.

zhaoyongjie avatar Nov 18 '22 08:11 zhaoyongjie

手动调整顺序, 即metrics control里面的metrics可以手动调整顺序.

您的意思的是调整这里的顺序吗? 但是在折线图中调整这里的顺序,legend仍然会被重排为字母顺序 WX20221118-165846

M1s4k1 avatar Nov 18 '22 09:11 M1s4k1

手动调整顺序, 即metrics control里面的metrics可以手动调整顺序.

您的意思的是调整这里的顺序吗? 但是在折线图中调整这里的顺序,legend仍然会被重排为字母顺序 WX20221118-165846

我刚明白, 您如果只关心Legend顺序, 那么这是个前端问题, 你需要修改前端的line-chart plugins. 而不是修改post_processing operator.

zhaoyongjie avatar Nov 18 '22 09:11 zhaoyongjie

感谢 我再去看看

M1s4k1 avatar Nov 18 '22 09:11 M1s4k1

Codecov Report

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

Comparison is base (17c2bd8) 66.99% compared to head (9154a4f) 54.22%. Report is 1939 commits behind head on master.

Files Patch % Lines
superset/utils/pandas_postprocessing/pivot.py 0.00% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #22164       +/-   ##
===========================================
- Coverage   66.99%   54.22%   -12.78%     
===========================================
  Files        1833     2011      +178     
  Lines       69936    91477    +21541     
  Branches     7572     7572               
===========================================
+ Hits        46855    49604     +2749     
- Misses      21121    39913    +18792     
  Partials     1960     1960               
Flag Coverage Δ
hive 54.37% <0.00%> (+1.76%) :arrow_up:
mysql ?
postgres ?
presto 53.72% <0.00%> (+1.23%) :arrow_up:
python 54.51% <0.00%> (-26.88%) :arrow_down:
sqlite ?
unit ?

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 24 '24 17:01 codecov[bot]

Looks like this PR needs further discussion and touch-ups to pass CI. I'll convert it to draft for now. Please re-open when it is read for re-review, and we can merge it if people are aligned on the approach/solution. Thanks!

rusackas avatar Feb 13 '24 18:02 rusackas

Codecov Report

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

Project coverage is 54.22%. Comparing base (17c2bd8) to head (9154a4f). Report is 2459 commits behind head on master.

Files Patch % Lines
superset/utils/pandas_postprocessing/pivot.py 0.00% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #22164       +/-   ##
===========================================
- Coverage   66.99%   54.22%   -12.78%     
===========================================
  Files        1833     2011      +178     
  Lines       69936    91477    +21541     
  Branches     7572     7572               
===========================================
+ Hits        46855    49604     +2749     
- Misses      21121    39913    +18792     
  Partials     1960     1960               
Flag Coverage Δ
hive 54.37% <0.00%> (+1.76%) :arrow_up:
mysql ?
postgres ?
presto 53.72% <0.00%> (+1.23%) :arrow_up:
python 54.51% <0.00%> (-26.88%) :arrow_down:
sqlite ?
unit ?

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 08 '24 16:04 codecov-commenter