models/core.py and db_engine_specs/base.py both try to import each-other.
This is happening when startingcelery which loads sql_lab.py. This used to work with 0.35.2.
...
File "/home/superset/venv/lib/python3.7/site-packages/superset/sql_lab.py", line 43, in <module>
from superset.db_engine_specs import BaseEngineSpec
File "/home/superset/venv/lib/python3.7/site-packages/superset/db_engine_specs/__init__.py", line 36, in <module>
from superset.db_engine_specs.base import BaseEngineSpec
File "/home/superset/venv/lib/python3.7/site-packages/superset/db_engine_specs/base.py", line 54, in <module>
from superset.models.sql_lab import Query
File "/home/superset/venv/lib/python3.7/site-packages/superset/models/__init__.py", line 17, in <module>
from . import core, datasource_access_request, schedules, sql_lab, user_attributes
File "/home/superset/venv/lib/python3.7/site-packages/superset/models/core.py", line 55, in <module>
from superset.db_engine_specs.base import TimeGrain
ImportError: cannot import name 'TimeGrain' from 'superset.db_engine_specs.base' (/home/superset/venv/lib/python3.7/site-packages/superset/db_engine_specs/base.py)
Run celery flower --app=superset.sql_lab:celery_app
(please complete the following information):
Make sure these boxes are checked before submitting your issue - thank you!
Issues seems to be:
https://github.com/apache/incubator-superset/blob/2cd8ca94c8923c4320e305f92d74d282390646a5/superset/models/core.py#L55
Merged in #8284
Use the following command instead:
celery worker --app=superset.tasks.celery_app:app -Ofair
Use the config to define what get's imported by celery, example:
class CeleryConfig(object):
BROKER_URL = "redis://localhost:6379/0"
CELERY_IMPORTS = ("superset.sql_lab", "superset.tasks")
CELERY_RESULT_BACKEND = "redis://localhost:6379/0"
CELERYD_PREFETCH_MULTIPLIER = 10
CELERY_ACKS_LATE = True
Thanks, changing the celery app to superset.tasks.celery_app:app worked.
I was using a command line that was defined in 0.30 and was not updated since...
Most helpful comment
Use the following command instead:
celery worker --app=superset.tasks.celery_app:app -OfairUse the config to define what get's imported by celery, example: