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

[cache] Providing a mechanism for disabling the datasource/database cache #5315

Merged

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jun 29, 2018

This PR updates the cache-timeout delegation logic which previously checked whether the datasource or database cache_timeout evaluated to True rather than whether it was None. The distinction here is you should be able to set a cache-timeout of zero at the datasource/database level to indicate that the slice will not timeout.

I've also updated the form descriptions which explicitly mention the timeout is in seconds and what the fall back logic is, i.e.,

chart:
screen shot 2018-07-02 at 11 23 05 am

table:
screen shot 2018-07-02 at 11 22 13 am

database:
screen shot 2018-07-02 at 11 29 45 am

datasource:
screen shot 2018-07-02 at 11 21 48 am

cluster:
screen shot 2018-07-02 at 11 30 05 am

to: @graceguo-supercat @michellethomas @mistercrunch @timifasubaa

@john-bodley john-bodley force-pushed the john-bodley-fix-cache-timeout branch 3 times, most recently from 3526d1f to ae95be2 Compare June 29, 2018 05:06
@codecov-io
Copy link

codecov-io commented Jun 29, 2018

Codecov Report

Merging #5315 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5315      +/-   ##
==========================================
+ Coverage   61.33%   61.33%   +<.01%     
==========================================
  Files         369      369              
  Lines       23483    23484       +1     
  Branches     2713     2713              
==========================================
+ Hits        14404    14405       +1     
  Misses       9067     9067              
  Partials       12       12
Impacted Files Coverage Δ
superset/views/core.py 72.96% <ø> (ø) ⬆️
superset/connectors/sqla/views.py 70.47% <ø> (ø) ⬆️
superset/viz.py 81.35% <0%> (ø) ⬆️
superset/connectors/druid/views.py 68.24% <100%> (+0.21%) ⬆️

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 16d2633...662874b. Read the comment docs.

@mistercrunch
Copy link
Member

I think it's possible for cache_timeout to be an empty string too (maybe once it's set and cleared on the CRUD), I think that needs to be explicitly handled and tested too.

Also another good thing to do would be adding info in the help text which I think has been missing. We should make it clear we're expecting seconds and that 0 turns off the cache.

@john-bodley
Copy link
Member Author

@mistercrunch cache_timeout is an int and thus is NULL in the database if cleared in the CRUD view. The one caveat is -1 will evaluate to True.

@john-bodley
Copy link
Member Author

john-bodley commented Jul 1, 2018

I can update the form description. Note 0 doesn't disable the cache but really ensures that the cache will always miss.

@mistercrunch
Copy link
Member

LGMT

@john-bodley john-bodley force-pushed the john-bodley-fix-cache-timeout branch from ae95be2 to 7ddfbdd Compare July 2, 2018 18:30
@john-bodley
Copy link
Member Author

@mistercrunch I've updated the description in the FAB forms which should provide more transparency around caching and the fall back logic.

@mistercrunch
Copy link
Member

LGTM

@john-bodley john-bodley force-pushed the john-bodley-fix-cache-timeout branch from 7ddfbdd to 662874b Compare July 2, 2018 22:12
@john-bodley john-bodley merged commit 72d815c into apache:master Jul 2, 2018
@john-bodley john-bodley deleted the john-bodley-fix-cache-timeout branch July 2, 2018 22:32
john-bodley added a commit to john-bodley/superset that referenced this pull request Jul 5, 2018
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 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 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants