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

feat(plugin-chart-pivot-table): support series limit #17803

Merged
merged 5 commits into from
Dec 21, 2021

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Dec 17, 2021

SUMMARY

Support series limit along with row limit in Pivot Table v2.

Migration benchmark results:
10+: 0.38 s
100+: 0.25 s
1000+: 0.24 s
10000+: 0.36 s
100000+: 0.46 s

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
image

After:
image

TESTING INSTRUCTIONS

  1. Create a Pivot Table v2 chart
  2. Set a series limit and series limit metric
  3. Click run and go to View Query
  4. Verify that the query contains a JOIN subquery ordered by selected series limit metric and limit equal to series limit
  5. Verify that the query limit is equal to Cell limit and is ordereb by series limit metric.
  6. Remove series limit metric and rerun the query
  7. Verify that the query and JOIN subquery are ordered by the first selected metric in Metrics control

ADDITIONAL INFORMATION

CC @rusackas @graceguo-supercat

@kgabryje kgabryje changed the title feat(plugin-chart-pivot-table): support series limit [WIP] feat(plugin-chart-pivot-table): support series limit Dec 17, 2021
@kgabryje kgabryje requested a review from a team as a code owner December 17, 2021 16:04
@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 17, 2021
@kgabryje kgabryje changed the title [WIP] feat(plugin-chart-pivot-table): support series limit feat(plugin-chart-pivot-table): support series limit Dec 17, 2021
@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #17803 (f4a57f3) into master (f396818) will decrease coverage by 0.20%.
The diff coverage is 61.19%.

❗ Current head f4a57f3 differs from pull request most recent head 2318cc1. Consider uploading reports for the commit 2318cc1 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17803      +/-   ##
==========================================
- Coverage   67.18%   66.97%   -0.21%     
==========================================
  Files        1609     1608       -1     
  Lines       64796    64798       +2     
  Branches     6855     6851       -4     
==========================================
- Hits        43530    43399     -131     
- Misses      19410    19540     +130     
- Partials     1856     1859       +3     
Flag Coverage Δ
hive ?
mysql 82.18% <100.00%> (ø)
postgres 82.23% <100.00%> (ø)
presto ?
python 82.31% <100.00%> (-0.41%) ⬇️
sqlite 81.91% <100.00%> (ø)

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

Impacted Files Coverage Δ
...ns/legacy-plugin-chart-horizon/src/controlPanel.ts 100.00% <ø> (ø)
...acy-plugin-chart-paired-t-test/src/controlPanel.ts 100.00% <ø> (ø)
...gin-chart-parallel-coordinates/src/controlPanel.ts 100.00% <ø> (ø)
...legacy-plugin-chart-partition/src/controlPanel.tsx 33.33% <ø> (ø)
...egacy-plugin-chart-pivot-table/src/controlPanel.ts 100.00% <ø> (ø)
...gins/legacy-plugin-chart-rose/src/controlPanel.tsx 100.00% <ø> (ø)
...ns/legacy-plugin-chart-treemap/src/controlPanel.ts 100.00% <ø> (ø)
...gacy-preset-chart-nvd3/src/DistBar/controlPanel.ts 11.11% <ø> (ø)
...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx 100.00% <ø> (ø)
...chart-echarts/src/Timeseries/Area/controlPanel.tsx 50.00% <ø> (ø)
... and 47 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 f396818...2318cc1. Read the comment docs.

@betodealmeida betodealmeida added the risk:db-migration PRs that require a DB migration label Dec 17, 2021
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.

Yay for this feature! A few nits/suggestions, LMKWYT

params = json.loads(slc.params)
legacy_order_by = params.pop("legacy_order_by", None)
if legacy_order_by:
params["timeseries_limit_metric"] = legacy_order_by
Copy link
Member

Choose a reason for hiding this comment

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

also implement here

for slc in slices:
try:
params = json.loads(slc.params)
timeseries_limit_metric = params.pop("timeseries_limit_metric", None)
Copy link
Member

Choose a reason for hiding this comment

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

and same here

],
[
{
name: 'timeseries_limit_metric',
Copy link
Member

Choose a reason for hiding this comment

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

Let's rather use series_limit_metric, as timeseries_limit_metric is now deprecated.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@@ -90,15 +89,40 @@ const config: ControlPanelConfig = {
],
['adhoc_filters'],
emitFilterControl,
['limit'],
Copy link
Member

Choose a reason for hiding this comment

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

oh, also prefer the use of series_limit over limit

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

Can't use custom metrics in sort control.

image

image

@kgabryje
Copy link
Member Author

Can't use custom metrics in sort control.

Thank you @zhaoyongjie, well spotted! Issue fixed. Can you retest?

image

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

@kgabryje kgabryje merged commit 2c3f39f into apache:master Dec 21, 2021
shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
* feat(plugin-chart-pivot-table): support series limit

* Add a migration

* Use non-legacy series limit controls

* Add a todo comment

* Bug fix
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
* feat(plugin-chart-pivot-table): support series limit

* Add a migration

* Use non-legacy series limit controls

* Add a todo comment

* Bug fix
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 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 risk:db-migration PRs that require a DB migration size/L 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature_parity]Support series limits in Pivot Table v2
5 participants