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: request samples with default row limit #19456

Merged
merged 3 commits into from
Apr 1, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented Mar 31, 2022

SUMMARY

Currently samples are requested with the original row limit, which tends to be 10k. However, samples should by default return 1k rows. This changes the frontend logic to remove row_limit and row_offset from the requested query object so the backend can use the appropriate defaults. The reason this is done in the frontend is to ensure that it's still possible to paginate samples requests if needed. Also clean up some incorrect types + add __future__ annotations for cleaner python sig types.

AFTER

After the change the samples tab only displays 1k rows
image

BEFORE

Previously it would request 10k rows if the row limit control was set to 10k:
image

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

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.

LGTM! thanks for the fix.

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #19456 (9f1383b) into master (eab9388) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 9f1383b differs from pull request most recent head cf1b4e3. Consider uploading reports for the commit cf1b4e3 to get more accurate results

@@           Coverage Diff           @@
##           master   #19456   +/-   ##
=======================================
  Coverage   66.58%   66.58%           
=======================================
  Files        1676     1676           
  Lines       64176    64181    +5     
  Branches     6525     6525           
=======================================
+ Hits        42732    42737    +5     
  Misses      19745    19745           
  Partials     1699     1699           
Flag Coverage Δ
javascript 51.31% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...uperset-frontend/src/explore/exploreUtils/index.js 81.02% <100.00%> (+0.57%) ⬆️
superset/common/query_actions.py 93.15% <100.00%> (+0.09%) ⬆️
superset/common/query_object.py 95.26% <100.00%> (ø)

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 eab9388...cf1b4e3. Read the comment docs.

@villebro villebro merged commit d684ad0 into apache:master Apr 1, 2022
@villebro villebro deleted the villebro/samples_limit branch April 1, 2022 08:32
@villebro villebro added the lts-v1 label Apr 1, 2022
villebro added a commit that referenced this pull request Apr 3, 2022
* fix: request samples with default row limit

* lodashLint

* fix cypress test

(cherry picked from commit d684ad0)
villebro added a commit that referenced this pull request Apr 4, 2022
* fix: request samples with default row limit

* lodashLint

* fix cypress test

(cherry picked from commit d684ad0)
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 6, 2022
* fix: request samples with default row limit

* lodashLint

* fix cypress test

(cherry picked from commit d684ad0)
@sadpandajoe
Copy link
Member

🏷️ preset:2022.13

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* fix: request samples with default row limit

* lodashLint

* fix cypress test
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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 lts-v1 preset:2022.13 preset-io size/M 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants