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: fetch all owners for dashboard and chart listview filters and properties modal #9784

Merged
merged 1 commit into from Jun 4, 2020

Conversation

nytai
Copy link
Member

@nytai nytai commented May 12, 2020

SUMMARY

Superset api limits records to 20 by default. @bkyryliuk recently opened a PR(#9667) to fix some of the owners dropdowns so that all records are returned by the api. The pr received some push back since changing the defaults probably isn't the best approach. This PR requests all records for the owners endpoints to fix the issue flagged in #9667.

Originally we intended to add pagination (via infinite scroll) and backend filtering. While trying to implement that approach I hit some limitations in react-select's async mode that caused me to reimplement fetching using react-select in non async mode, code is here: 90f7f79

Also since there is currently an upgrade for react-select in progress (#9628) I opted for holding off on adding more complexity until the upgrade is complete. React select is fairly fast at searching and I don't think we should expect the owners list to be that large, so I'm not convinced that adding pagination will result in a more performant end user experience than fetching all records after mount and searching locally.

TEST PLAN

  • tested locally with 55 user records

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@codecov-io
Copy link

codecov-io commented May 12, 2020

Codecov Report

Merging #9784 into master will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9784      +/-   ##
==========================================
+ Coverage   70.79%   70.91%   +0.12%     
==========================================
  Files         587      183     -404     
  Lines       30435    17826   -12609     
  Branches     3152        0    -3152     
==========================================
- Hits        21545    12641    -8904     
+ Misses       8776     5185    -3591     
+ Partials      114        0     -114     
Flag Coverage Δ
#cypress ?
#javascript ?
#python 70.91% <ø> (-0.04%) ⬇️
Impacted Files Coverage Δ
superset/db_engine_specs/sqlite.py 63.33% <0.00%> (-10.01%) ⬇️
superset/result_set.py 96.63% <0.00%> (-1.69%) ⬇️
superset/sql_lab.py 77.63% <0.00%> (-0.44%) ⬇️
superset/db_engine_specs/base.py 87.50% <0.00%> (-0.30%) ⬇️
...-frontend/src/dashboard/util/getDragDropManager.js
.../dashboard/util/charts/getEffectiveExtraFilters.js
.../src/explore/components/FilterDefinitionOption.jsx
...rc/dashboard/components/FilterIndicatorTooltip.jsx
...c/dashboard/components/gridComponents/Markdown.jsx
...t-frontend/src/SqlLab/components/ColumnElement.jsx
... and 391 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 65d185f...2f68649. Read the comment docs.

@ktmud
Copy link
Member

ktmud commented May 12, 2020

This most likely will conflict with #9628

@nytai
Copy link
Member Author

nytai commented May 12, 2020

@ktmud If #9628 is ready to merge soon, this PR can wait and I'll resolve the conflicts. Thanks for the heads up

@nytai nytai changed the title [Charts & Dashboards] fix, fetch all owners for filters and properties modal fix: fetch all owners for dashboard and chart listview filters and properties modal May 12, 2020
@ktmud
Copy link
Member

ktmud commented May 12, 2020

It's not ready for merge yet. Just a heads up how they might interfere with each other. Here are the related changes: d2050b5

Feel free to merge your changes first if you are ready.

@nytai nytai marked this pull request as ready for review May 13, 2020 16:02
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2020

Codecov Report

Merging #9784 into master will increase coverage by 0.00%.
The diff coverage is 61.36%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9784   +/-   ##
=======================================
  Coverage   71.35%   71.36%           
=======================================
  Files         585      585           
  Lines       30917    30932   +15     
  Branches     3246     3252    +6     
=======================================
+ Hits        22061    22074   +13     
  Misses       8747     8747           
- Partials      109      111    +2     
Flag Coverage Δ
#cypress 54.04% <0.00%> (-0.03%) ⬇️
#javascript 59.40% <61.36%> (+<0.01%) ⬆️
#python 71.54% <ø> (+0.03%) ⬆️
Impacted Files Coverage Δ
...rontend/src/explore/components/PropertiesModal.tsx 16.66% <0.00%> (ø)
...uperset-frontend/src/views/chartList/ChartList.tsx 60.56% <52.94%> (-2.68%) ⬇️
...frontend/src/views/dashboardList/DashboardList.tsx 66.19% <66.66%> (+2.49%) ⬆️
...set-frontend/src/views/datasetList/DatasetList.tsx 55.04% <66.66%> (+0.41%) ⬆️
...erset-frontend/src/components/ListView/Filters.tsx 88.88% <100.00%> (ø)
superset-frontend/src/components/ListView/utils.ts 83.14% <100.00%> (+0.19%) ⬆️
superset-frontend/src/SqlLab/actions/sqlLab.js 66.15% <0.00%> (-0.66%) ⬇️
superset/sql_lab.py 78.26% <0.00%> (+0.43%) ⬆️
superset/result_set.py 98.31% <0.00%> (+1.68%) ⬆️
... and 1 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 1001c6d...1565405. Read the comment docs.

@nytai nytai requested review from rusackas and dpgaspar June 3, 2020 16:11
Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

@nytai nytai merged commit d187d28 into apache:master Jun 4, 2020
@nytai nytai deleted the tai/request-all-records branch June 4, 2020 02:57
nytai added a commit to preset-io/superset that referenced this pull request Jun 4, 2020
@bkyryliuk
Copy link
Member

@nytai looks like pagination is still not working for the charts CRUD on the latest master
image

For now we are keeping #9667 as a cherry pick for it to work

auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.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/L 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants