-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[Caching] Ensure cache is always created #9020
Conversation
302f3d2
to
1e18818
Compare
Codecov Report
@@ Coverage Diff @@
## master #9020 +/- ##
=======================================
Coverage 59.15% 59.15%
=======================================
Files 367 367
Lines 11686 11686
Branches 2866 2866
=======================================
Hits 6913 6913
Misses 4594 4594
Partials 179 179 Continue to review full report at Codecov.
|
# Accepts a custom cache initialization function, | ||
# returning an object compatible with Flask-Caching API | ||
return cache_config(app) | ||
if isinstance(cache_config, dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this was confusing logic
1e18818
to
640dccb
Compare
@@ -571,10 +572,6 @@ class CeleryConfig: # pylint: disable=too-few-public-methods | |||
SMTP_PASSWORD = "superset" | |||
SMTP_MAIL_FROM = "superset@superset.com" | |||
|
|||
if not CACHE_DEFAULT_TIMEOUT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is in the same block as line #313 and always evaluates to True
and thus isn't required (hence the deletion).
* [Caching] Ensure cache is always created * Update cache_manager.py * Refactoring cache typing (cherry picked from commit 68e85ab)
CATEGORY
Choose one
SUMMARY
Flask-Caching supports passing in
"null"
as the cache type, which resolves to no caching at all (https://flask-caching.readthedocs.io/en/latest/#nullcache). This is preferred to setting the cache toNone
so that we can assume a cache is always initialized and calls tocache.memoize()
will never fail.TEST PLAN
CI
ADDITIONAL INFORMATION
REVIEWERS
to: @john-bodley @craig-rueda @villebro @mistercrunch