You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/05 15:52:39 UTC

[GitHub] [airflow] ashb commented on a change in pull request #14612: Default to Celery Task model when backend model does not exist

ashb commented on a change in pull request #14612:
URL: https://github.com/apache/airflow/pull/14612#discussion_r588410178



##########
File path: airflow/executors/celery_executor.py
##########
@@ -567,7 +567,7 @@ def _get_many_from_kv_backend(self, async_tasks) -> Mapping[str, EventBufferValu
     def _get_many_from_db_backend(self, async_tasks) -> Mapping[str, EventBufferValueType]:
         task_ids = _tasks_list_to_task_ids(async_tasks)
         session = app.backend.ResultSession()
-        task_cls = app.backend.task_cls
+        task_cls = app.backend.task_cls if hasattr(app.backend, "task_cls") else TaskDb

Review comment:
       ```suggestion
           task_cls = getattr(app.backend, 'task_cls', TaskDb)
   ```




----------------------------------------------------------------
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