superset: Error while running superset db upgrade
I am trying to install apache superset and got an error while running superset db upgrade command
How to reproduce the bug
- Open/create virtual environment with linux
- Then install the superset
- After that upgrade the db by the command: superset db upgrade
Expected results
I am expecting that by running the command superset db upgrade the database will load some sample data
Actual results
getting error saying that AttributeError: module ‘sqlparse.keywords’ has no attribute ‘FLAGS’ Error: Traceback (most recent call last): File “/root/supersetdata/bin/superset”, line 5, in <module> from superset.cli.main import superset File “/root/supersetdata/lib/python3.10/site-packages/superset/init.py”, line 21, in <module> from superset.app import create_app File “/root/supersetdata/lib/python3.10/site-packages/superset/app.py”, line 23, in <module> from superset.initialization import SupersetAppInitializer File “/root/supersetdata/lib/python3.10/site-packages/superset/initialization/init.py”, line 33, in <module> from superset.extensions import ( File “/root/supersetdata/lib/python3.10/site-packages/superset/extensions/init.py”, line 32, in <module> from superset.utils.async_query_manager import AsyncQueryManager File “/root/supersetdata/lib/python3.10/site-packages/superset/utils/async_query_manager.py”, line 26, in <module> from superset.utils.core import get_user_id File “/root/supersetdata/lib/python3.10/site-packages/superset/utils/core.py”, line 106, in <module> from superset.sql_parse import sanitize_clause File “/root/supersetdata/lib/python3.10/site-packages/superset/sql_parse.py”, line 67, in <module> re.compile(r"‘(’‘|\\|\|[^’])*'", sqlparse.keywords.FLAGS).match, AttributeError: module ‘sqlparse.keywords’ has no attribute ‘FLAGS’
Screenshots

Environment
(please complete the following information):
- browser type and version: I am running in python virtual env
- superset version:
1.4 - python version:
3.10.6 - node.js version:
NA - any feature flags active: no
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 20 (3 by maintainers)
Please do not mention random nicknames: if everybody does that, superset users and contributors would get flooded with non-relevant notifications. I would also suggest copying and paste text instead of screenshot it, as that makes it less readable.
I don’t see any error, CSP is a warning, you can understand it more by reading https://superset.apache.org/docs/security/#content-security-policy-csp
Regarding Caching, it’s another warning that you didn’t configure any caching, I use redis on my ubuntu, setting it up is easy and on the official documentation you can configure it https://superset.apache.org/docs/installation/cache
Anyway, your Superset works even with ignoring those two warnings, but it’s preferable to setup a caching system, and it might be preferable to setup CSP in case your Superset will get public access.
you need to setup your flask app
it it doesn’t work, then you need to try out