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/10 02:00:47 UTC

[GitHub] [airflow] RNHTTR commented on issue #14163: TypeError: object of type 'map' has no len(): When celery executor multi-processes to get Task Instances

RNHTTR commented on issue #14163:
URL: https://github.com/apache/airflow/issues/14163#issuecomment-794733933


   `BulkStateFetcher`'s `get_many` method expects (i think) an iterable of `AsyncResult`s. So, I think the map is necessary.
   
   ```python
   states_by_celery_task_id = self.bulk_state_fetcher.get_many(
               map(operator.itemgetter(0), celery_tasks.values())
   )
   ```
   
   This bit creates a map object that gets the 0th element of each tuple in `celery_tasks.values()` I _think_ all we need to do is cast the map object to a list:
   
   ```python
   list(map(operator.itemgetter(0), celery_tasks.values()))
   ```
   
   I'm gonna dig a bit deeper to confirm & hopefully submit a PR tomorrow.


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