-
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
chore(celery): Cleanup config and async query specifications #25314
chore(celery): Cleanup config and async query specifications #25314
Conversation
'sql_lab.get_sql_results': { | ||
'rate_limit': '100/s', | ||
}, | ||
'email_reports.send': { |
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.
The email_reports.send
task does not exist.
imports = ('superset.sql_lab', "superset.tasks", "superset.tasks.thumbnails", ) | ||
result_backend = 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT) | ||
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/0" | ||
imports = ( |
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.
Imports should include importing the modules where the associated tasks are defined.
) | ||
result_backend = 'redis://localhost:6379/0' | ||
worker_log_level = 'DEBUG' |
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.
Setting does not exist.
'sql_lab.get_sql_results': { | ||
'rate_limit': '100/s', | ||
}, | ||
'email_reports.send': { |
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.
Task not not exist.
}, | ||
} | ||
beat_schedule = { | ||
'email_reports.schedule_hourly': { |
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.
Task does not exist.
imports = ('superset.sql_lab', "superset.tasks", "superset.tasks.thumbnails", ) | ||
imports = ( | ||
"superset.sql_lab", | ||
"superset.tasks.cache", |
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.
Module where the caching logic is defined.
broker_url = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" | ||
imports = ('superset.sql_lab', "superset.tasks", "superset.tasks.thumbnails", ) |
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.
No value in importing superset.tasks
as the __init__.py
is empty.
superset/config.py
Outdated
@@ -1498,13 +1490,7 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument | |||
|
|||
# Global async query config options. | |||
# Requires GLOBAL_ASYNC_QUERIES feature flag to be enabled. | |||
GLOBAL_ASYNC_QUERIES_REDIS_CONFIG = { |
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.
These were the same as the defaults and thus unncessary.
CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}" | ||
CELERY_ANNOTATIONS = {"sql_lab.add": {"rate_limit": "10/s"}} | ||
CONCURRENCY = 1 | ||
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" |
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.
These config settings were renamed and will be removed in Celery 6.0.
CELERY_IMPORTS = ("superset.sql_lab", "superset.tasks.thumbnails") | ||
CELERY_ANNOTATIONS = {"sql_lab.add": {"rate_limit": "10/s"}} | ||
CONCURRENCY = 1 | ||
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" |
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.
These config settings were renamed and will be removed in Celery 6.0.
00ece63
to
9107e1e
Compare
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.
LGTM
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.
just a small comment, thank for doing this!
imports = ( | ||
'superset.sql_lab', | ||
'superset.tasks', | ||
"superset.sql_lab', |
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.
"superset.sql_lab',
-> "superset.sql_lab",
…and-documentation
SUMMARY
Whilst spelunking through the code looking at global async queries and Celery I realized that there was a number of inconsistencies with how the various
CeleryConfig
et al. objects were defined (referencing legacy settings or outdated tasks). This PR cleans up said logic.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION