Skip to content

Conversation

@bryanck
Copy link
Contributor

@bryanck bryanck commented Jan 21, 2021

SUMMARY

This adds an order by clause for the bar chart, ordering by the first metric descending. Without the ordering, the query will return an arbitrary set of rows if the query is limited, rather than the top N rows.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Create a bar chart against a dataset. Limit the result to something less than the total number of rows. The top N rows, based on the metric, should be returned.

ADDITIONAL INFORMATION

Fixes #12622

@bryanck bryanck changed the title add order by for bar charts fix: add order by for bar charts Jan 21, 2021
@codecov-io
Copy link

codecov-io commented Jan 21, 2021

Codecov Report

Merging #12661 (e72968d) into master (734fb75) will decrease coverage by 3.63%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12661      +/-   ##
==========================================
- Coverage   66.85%   63.21%   -3.64%     
==========================================
  Files        1018      486     -532     
  Lines       49776    29983   -19793     
  Branches     4869        0    -4869     
==========================================
- Hits        33278    18954   -14324     
+ Misses      16375    11029    -5346     
+ Partials      123        0     -123     
Flag Coverage Δ
cypress ?
javascript ?
python 63.21% <100.00%> (-0.80%) ⬇️

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

Impacted Files Coverage Δ
superset/viz.py 60.02% <100.00%> (+0.02%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/db_engine_specs/hive.py 54.61% <0.00%> (-29.24%) ⬇️
superset/databases/commands/create.py 83.67% <0.00%> (-8.17%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/connectors/sqla/models.py 84.31% <0.00%> (-6.28%) ⬇️
superset/db_engine_specs/sqlite.py 90.62% <0.00%> (-6.25%) ⬇️
superset/databases/commands/test_connection.py 84.78% <0.00%> (-4.35%) ⬇️
superset/utils/celery.py 96.42% <0.00%> (-3.58%) ⬇️
... and 543 more

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 734fb75...e72968d. 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.

Thanks for the fix @bryanck !

@bryanck
Copy link
Contributor Author

bryanck commented Jan 22, 2021

Sure, though I noticed this is happening elsewhere, so I'll have another PR (word cloud, multi-line graphs)

@villebro villebro merged commit 5504762 into apache:master Jan 22, 2021
@junlincc junlincc added the viz:charts:bar Related to the Bar chart label Jan 23, 2021
@junlincc junlincc added the v1.1 label Jan 31, 2021
@villebro villebro added v1.0.1 and removed v1.1 labels Feb 2, 2021
villebro pushed a commit that referenced this pull request Feb 2, 2021
@mistercrunch mistercrunch added 🍒 1.0.1 Cherry-picked to 1.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 First shipped in 1.2.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/XS v1.0.1 viz:charts:bar Related to the Bar chart 🍒 1.0.1 Cherry-picked to 1.0.1 🚢 1.2.0 First shipped in 1.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[explore]Bar chart doesn't sort descending anymore

5 participants