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: nvd3 bar chart sortby metric #15318

Merged
merged 3 commits into from
Jun 30, 2021

Conversation

zhaoyongjie
Copy link
Member

SUMMARY

currently, nvd3 bar chart(non-timeseries) can not be sorted by metric. this PR fixed it.

closes: #15260

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before

issue link: #15260

after

Jun-23-2021.02-34-07.mp4

TESTING INSTRUCTIONS

tested in local

ADDITIONAL INFORMATION

  • Has associated issue: [chart]Bar Chart sorting does not appear to work as intended. #15260
  • 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

@@ -999,7 +1000,8 @@ def test_explore_json_dist_bar_order(self):
SELECT count(name) AS count_name, count(ds) AS count_ds
FROM birth_names
WHERE ds >= '1921-01-22 00:00:00.000000' AND ds < '2021-01-22 00:00:00.000000'
GROUP BY name ORDER BY count_name DESC, count_ds DESC
Copy link
Member Author

Choose a reason for hiding this comment

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

For the distributed bar only a single metric can be sorted.

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #15318 (da4d734) into master (ab153e6) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15318      +/-   ##
==========================================
+ Coverage   77.14%   77.22%   +0.08%     
==========================================
  Files         973      973              
  Lines       50473    50481       +8     
  Branches     6183     6183              
==========================================
+ Hits        38938    38985      +47     
+ Misses      11329    11290      -39     
  Partials      206      206              
Flag Coverage Δ
hive 81.41% <100.00%> (-0.01%) ⬇️
mysql 81.68% <100.00%> (-0.01%) ⬇️
postgres 81.69% <100.00%> (-0.01%) ⬇️
presto 81.40% <100.00%> (?)
python 82.23% <100.00%> (+0.15%) ⬆️
sqlite 81.33% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/viz.py 56.52% <100.00%> (+0.04%) ⬆️
superset/views/core.py 75.54% <0.00%> (-0.04%) ⬇️
superset/views/sql_lab.py 60.68% <0.00%> (ø)
superset/models/core.py 90.02% <0.00%> (+0.26%) ⬆️
superset/connectors/sqla/models.py 89.87% <0.00%> (+1.41%) ⬆️
superset/db_engine_specs/presto.py 90.31% <0.00%> (+5.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab153e6...da4d734. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM - based on the code changes it appears sorting didn't support adhoc metrics before, thanks for fixing both issues :)

@zhaoyongjie zhaoyongjie merged commit 61e6b70 into apache:master Jun 30, 2021
@john-bodley john-bodley mentioned this pull request Nov 9, 2021
9 tasks
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[chart]Bar Chart sorting does not appear to work as intended.
3 participants