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: request ids on API related endpoints #12663

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Jan 21, 2021

SUMMARY

Supports requested model ids on the related API endpoints #11680. The related endpoints are paginated to prevent heavy queries on the metadata database, these endpoints are normally used to fill up dropdowns on the frontend. If a dropdown box already contains ids these may be out of the requested page.

The solution keeps the pagination (currently to solve this the frontend is requesting a very big page) but adds requested ids to the API response

The related endpoint does not break compatibility but adds a new query option:

{
  "filter": "alpha",
  "include_ids": [1,2,3],
  "page": 0,
  "page_size": 1000
}

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

@codecov-io
Copy link

codecov-io commented Jan 21, 2021

Codecov Report

Merging #12663 (4c69402) into master (734fb75) will decrease coverage by 3.44%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12663      +/-   ##
==========================================
- Coverage   66.85%   63.40%   -3.45%     
==========================================
  Files        1018      488     -530     
  Lines       49776    30128   -19648     
  Branches     4869        0    -4869     
==========================================
- Hits        33278    19103   -14175     
+ Misses      16375    11025    -5350     
+ Partials      123        0     -123     
Flag Coverage Δ
cypress ?
javascript ?
python 63.40% <100.00%> (-0.61%) ⬇️

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

Impacted Files Coverage Δ
superset/charts/schemas.py 100.00% <ø> (ø)
superset/views/base_api.py 97.79% <100.00%> (-0.36%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/views/database/views.py 62.69% <0.00%> (-24.88%) ⬇️
superset/databases/commands/create.py 83.67% <0.00%> (-8.17%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/sql_validators/base.py 93.33% <0.00%> (-6.67%) ⬇️
superset/db_engine_specs/base.py 79.59% <0.00%> (-6.38%) ⬇️
superset/db_engine_specs/sqlite.py 90.62% <0.00%> (-6.25%) ⬇️
superset/views/database/forms.py 83.33% <0.00%> (-5.56%) ⬇️
... and 564 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...4c69402. Read the comment docs.

@dpgaspar dpgaspar merged commit 365770e into apache:master Jan 27, 2021
@dpgaspar dpgaspar deleted the perf/related-api branch January 27, 2021 20:24
graceguo-supercat pushed a commit to airbnb/superset-fork that referenced this pull request Feb 10, 2021
* feat: request ids on API related endpoints

* rename ids to include_ids

(cherry picked from commit 365770e)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 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 preset-io size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants