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(dashboard): Add caching for dashboard datasets #14306

Merged
merged 9 commits into from
Apr 24, 2021

Conversation

suddjian
Copy link
Member

@suddjian suddjian commented Apr 22, 2021

SUMMARY

Fixes issues discussed here: #13306 (comment)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Turn on caching, add a breakpoint or log message or other side effect to the cached function, refresh dashboard, verify side effect only happened once.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #14306 (01e2375) into master (c760030) will increase coverage by 0.20%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14306      +/-   ##
==========================================
+ Coverage   77.01%   77.22%   +0.20%     
==========================================
  Files         954      954              
  Lines       48071    48962     +891     
  Branches     5973     5973              
==========================================
+ Hits        37024    37812     +788     
- Misses      10850    10953     +103     
  Partials      197      197              
Flag Coverage Δ
hive 80.46% <80.00%> (+0.01%) ⬆️
javascript 72.10% <ø> (ø)
mysql 81.15% <75.00%> (+0.41%) ⬆️
postgres 80.78% <80.00%> (+0.01%) ⬆️
presto ?
python 81.55% <80.00%> (+0.23%) ⬆️
sqlite 80.78% <75.00%> (+0.40%) ⬆️

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

Impacted Files Coverage Δ
superset/models/dashboard.py 77.41% <75.00%> (+2.41%) ⬆️
superset/dashboards/dao.py 95.45% <100.00%> (-0.13%) ⬇️
superset/db_engine_specs/__init__.py 71.69% <0.00%> (-10.13%) ⬇️
superset/db_engine_specs/presto.py 84.42% <0.00%> (-5.90%) ⬇️
superset/datasets/commands/importers/v1/utils.py 53.57% <0.00%> (-5.34%) ⬇️
superset/db_engine_specs/postgres.py 94.21% <0.00%> (-2.63%) ⬇️
superset/connectors/sqla/models.py 88.61% <0.00%> (-1.46%) ⬇️
superset/config.py 89.85% <0.00%> (-1.18%) ⬇️
superset/models/core.py 88.85% <0.00%> (-0.28%) ⬇️
...erset/dashboards/commands/importers/v1/__init__.py 100.00% <0.00%> (ø)
... and 7 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 c760030...01e2375. Read the comment docs.

@etr2460
Copy link
Member

etr2460 commented Apr 23, 2021

Looks like there's still some unit test issues to resolve tomorrow

@suddjian
Copy link
Member Author

I suspect it's not kosher to add caching to a function that returns a sqlalchemy object

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

this lgtm, I think you'll need to rebase on master to unbreak CI though.

Let's see what the perf impact is here, and i'll have etag stuff soon (as soon as i can actually find time to write code for my job as a software engineer :P )

@suddjian suddjian force-pushed the dashboard-spa-caching branch from 01e2375 to 2f6b74e Compare April 24, 2021 02:45
@suddjian suddjian merged commit 91ba897 into master Apr 24, 2021
@suddjian suddjian deleted the dashboard-spa-caching branch April 24, 2021 04:05
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix(dashboard): [WIP] add caching back in to the dashboard dataset api

* caching works! remove log message

* remove unused full_data method

* add caching to the charts endpoint as well

* spread the cache love

* lint

* Revert "spread the cache love"

This reverts commit ef322a3.

* Revert "add caching to the charts endpoint as well"

This reverts commit d3d1584.

* it's a list
@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/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants