You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/25 01:51:59 UTC
[GitHub] [incubator-superset] etr2460 opened a new pull request #9020:
[Caching] Ensure cache is always created
etr2460 opened a new pull request #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020
### CATEGORY
Choose one
- [x] Bug Fix
- [ ] Enhancement (new features, refinement)
- [ ] Refactor
- [ ] Add tests
- [ ] Build / Development Environment
- [ ] Documentation
### 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 to `None` so that we can assume a cache is always initialized and calls to `cache.memoize()` will never fail.
### TEST PLAN
CI
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] 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
to: @john-bodley @craig-rueda @villebro @mistercrunch
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io commented on issue #9020: [Caching]
Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020#issuecomment-578368494
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=h1) Report
> Merging [#9020](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/c552c852cdb12392ebbc3024b36d328774b53606?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9020/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=tree)
```diff
@@ 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](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=footer). Last update [c552c85...1e18818](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on issue #9020:
[Caching] Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020#issuecomment-578368494
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=h1) Report
> Merging [#9020](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/c552c852cdb12392ebbc3024b36d328774b53606?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9020/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=tree)
```diff
@@ 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](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=footer). Last update [c552c85...640dccb](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on issue #9020:
[Caching] Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020#issuecomment-578368494
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=h1) Report
> Merging [#9020](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/c552c852cdb12392ebbc3024b36d328774b53606?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9020/graphs/tree.svg?width=650&token=KsB0fHcx6l&height=150&src=pr)](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=tree)
```diff
@@ 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](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=footer). Last update [c552c85...640dccb](https://codecov.io/gh/apache/incubator-superset/pull/9020?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] john-bodley commented on a change in pull
request #9020: [Caching] Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020#discussion_r370917499
##########
File path: superset/config.py
##########
@@ -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:
Review comment:
This logic is in the same block as line #313 and always evaluates to `True` and thus isn't required (hence the deletion).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] dpgaspar merged pull request #9020: [Caching]
Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
dpgaspar merged pull request #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] craig-rueda commented on a change in pull
request #9020: [Caching] Ensure cache is always created
Posted by GitBox <gi...@apache.org>.
craig-rueda commented on a change in pull request #9020: [Caching] Ensure cache is always created
URL: https://github.com/apache/incubator-superset/pull/9020#discussion_r370911191
##########
File path: superset/utils/cache_manager.py
##########
@@ -27,30 +27,26 @@ def __init__(self) -> None:
self._tables_cache = None
self._cache = None
- def init_app(self, app):
- self._cache = self._setup_cache(app, app.config.get("CACHE_CONFIG"))
+ def init_app(self, app: Flask) -> None:
+ self._cache = self._setup_cache(app, app.config["CACHE_CONFIG"])
self._tables_cache = self._setup_cache(
- app, app.config.get("TABLE_NAMES_CACHE_CONFIG")
+ app, app.config["TABLE_NAMES_CACHE_CONFIG"]
)
@staticmethod
- def _setup_cache(app: Flask, cache_config) -> Optional[Cache]:
+ def _setup_cache(app: Flask, cache_config: CacheConfig) -> Cache:
"""Setup the flask-cache on a flask app"""
- if cache_config:
- if isinstance(cache_config, dict):
- if cache_config.get("CACHE_TYPE") != "null":
- return Cache(app, config=cache_config)
- else:
- # Accepts a custom cache initialization function,
- # returning an object compatible with Flask-Caching API
- return cache_config(app)
+ if isinstance(cache_config, dict):
Review comment:
Nice, this was confusing logic
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org