Incubator-superset: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.

Created on 8 Feb 2017  路  13Comments  路  Source: apache/incubator-superset

(superset) [root@edeppreapp01 superset-0.15.4]# ./bin/python ./lib/python2.7/site-packages/superset/cli.py runserver -d -p 8888
/root/superset-0.15.4/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
.format(x=modname), ExtDeprecationWarning
/root/superset-0.15.4/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
.format(x=modname), ExtDeprecationWarning
/root/superset-0.15.4/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.sqlalchemy._compat is deprecated, use flask_sqlalchemy._compat instead.
.format(x=modname), ExtDeprecationWarning
/root/superset-0.15.4/lib/python2.7/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
/root/superset-0.15.4/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
.format(x=modname), ExtDeprecationWarning

Most helpful comment

I have rebuilt docker image with superset master with following CACHE_CONFIG setting in Superset. But still got this warning. not sure why not logging with CACHE_TYPE is redis.

Rebuilt docker image has already installed redis byt "pip install redis"

CACHE_CONFIG = {
  'CACHE_TYPE': 'redis',
  'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
  'CACHE_KEY_PREFIX': 'superset_results',
  'CACHE_REDIS_URL': 'redis://gohub-tidb-cluster-tidis.gohub-minikube.svc:5379/0',
}

All 13 comments

(superset) [root@edeppreapp01 superset-0.15.4]# ./bin/python ./bin/pip freeze
alembic==0.8.8
amqp==1.4.9
anyjson==0.3.3
Babel==2.3.4
billiard==3.3.0.23
caravel==0.10.0
celery==3.1.23
ceres==0.10.0rc1
cffi==1.8.2
CherryPy==6.1.1
click==6.6
colorama==0.3.7
cryptography==1.5.3
docopt==0.6.2
enum34==1.1.6
Flask==0.11.1
Flask-AppBuilder==1.8.1
Flask-Babel==0.11.1
Flask-BabelPkg==0.9.6
Flask-Cache==0.13.1
Flask-Login==0.2.11
Flask-Migrate==1.5.1
Flask-OpenID==1.2.5
Flask-Script==2.0.5
Flask-SQLAlchemy==2.0
Flask-Testing==0.5.0
Flask-WTF==0.12
future==0.15.2
gunicorn==19.6.0
humanize==0.5.1
idna==2.1
ipaddress==1.0.17
itsdangerous==0.24
Jinja2==2.8
kafka-python==0.9.5
kombu==3.0.35
Mako==1.0.4
Markdown==2.6.6
MarkupSafe==0.23
numpy==1.11.1
pandas==0.18.1
panoramix==0.5.3
parsedatetime==2.0
ptvsd==2.2.0
pyasn1==0.1.9
pycharm===debug
pycparser==2.14
pydruid==0.3.1
PyHive==0.2.1
PyMySQL==0.7.9
pysqlite==2.8.3
python-dateutil==2.5.3
python-editor==1.0.1
python-openid==2.2.5
pytz==2016.6.1
requests==2.10.0
sasl==0.2.1
simplejson==3.8.2
six==1.10.0
speaklater==1.3
SQLAlchemy==1.0.13
SQLAlchemy-Utils==0.32.7
sqlparse==0.1.19
superset==0.15.4
thrift==0.9.3
thrift-sasl==0.2.1
virtualenv==15.1.0
Werkzeug==0.11.10
whisper==0.9.15
WTForms==2.1

Should we ignore this warning should, or set a CACHE_TYPE for Flask-Cache?

I think it's fine to not have a cache backend configured by default.

Alright... just feel not good when i saw the ExtDeprecationWarning.

Should we add warnings.simplefilter('ignore', ExtDeprecationWarning) to ignore it?

The deprecation warnings are not coming from superset code (and they are unrelated to superset setting a cache or not), a new release of flask app builder will be released hopefully :)

Yep, i also think so.

Aha, it could be fixed in Superset.

(superset) [root@edeppreapp01 superset-0.15.4]# ./bin/python ./lib/python2.7/site-packages/superset/cli.py runserver -a 0.0.0.0 -p 8888
/root/superset-0.15.4/lib/python2.7/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
2017-02-08 16:33:11,601:INFO:flask_appbuilder.base:Registering class MyIndexView on menu
2017-02-08 16:33:11,608:INFO:flask_appbuilder.base:Registering class UtilView on menu
2017-02-08 16:33:11,613:INFO:flask_appbuilder.base:Registering class LocaleView on menu
2017-02-08 16:33:11,618:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu
2017-02-08 16:33:11,647:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu
2017-02-08 16:33:11,679:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu
2017-02-08 16:33:11,708:INFO:flask_appbuilder.base:Registering class AuthDBView on menu

Wait a min, i create a PR...

It could bring PEP 8 problems, but warnings.simplefilter('ignore', ExtDeprecationWarning) must be before performing any imports that would raise the warning...

Should we disable checks about PEP8 for it? T^T

@xrmx Alright, all test cases passed. Please help me to check it. Thx.

I have rebuilt docker image with superset master with following CACHE_CONFIG setting in Superset. But still got this warning. not sure why not logging with CACHE_TYPE is redis.

Rebuilt docker image has already installed redis byt "pip install redis"

CACHE_CONFIG = {
  'CACHE_TYPE': 'redis',
  'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
  'CACHE_KEY_PREFIX': 'superset_results',
  'CACHE_REDIS_URL': 'redis://gohub-tidb-cluster-tidis.gohub-minikube.svc:5379/0',
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

thoralf-gutierrez picture thoralf-gutierrez  路  3Comments

deity-bram picture deity-bram  路  3Comments

john-bodley picture john-bodley  路  3Comments

gbrian picture gbrian  路  3Comments

shyam2794 picture shyam2794  路  3Comments