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/23 19:39:06 UTC

[GitHub] [airflow] RNHTTR commented on a change in pull request #14883: Fix celery executor bug trying to call len on map

RNHTTR commented on a change in pull request #14883:
URL: https://github.com/apache/airflow/pull/14883#discussion_r599876910



##########
File path: airflow/executors/celery_executor.py
##########
@@ -547,11 +547,12 @@ def get_many(self, async_results) -> Mapping[str, EventBufferValueType]:
         """Gets status for many Celery tasks using the best method available."""
         if isinstance(app.backend, BaseKeyValueStoreBackend):
             result = self._get_many_from_kv_backend(async_results)
-            return result
-        if isinstance(app.backend, DatabaseBackend):
+        elif isinstance(app.backend, DatabaseBackend):
             result = self._get_many_from_db_backend(async_results)
-            return result
-        result = self._get_many_using_multiprocessing(async_results)
+        else:
+            async_results = list(async_results)
+            result = self._get_many_using_multiprocessing(async_results)
+        async_results = list(async_results) if isinstance(async_results, map) else async_results

Review comment:
       @kaxil Done. One of these days I'll have a PR that includes a test ;)




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