uranusjr commented on code in PR #33050:
URL: https://github.com/apache/airflow/pull/33050#discussion_r1282689188
##########
airflow/providers/celery/executors/celery_executor_utils.py:
##########
@@ -298,7 +298,7 @@ def _get_many_using_multiprocessing(self, async_results) ->
Mapping[str, EventBu
num_process = min(len(async_results), self._sync_parallelism)
with ProcessPoolExecutor(max_workers=num_process) as sync_pool:
- chunksize = max(1, math.floor(math.ceil(1.0 * len(async_results) /
self._sync_parallelism)))
+ chunksize = max(1, math.ceil(len(async_results) /
self._sync_parallelism))
Review Comment:
I wonder why the outer `floor` existed in the first place. That wouldn’t do
anything on Python 2 either…
##########
airflow/providers/celery/executors/celery_executor_utils.py:
##########
@@ -298,7 +298,7 @@ def _get_many_using_multiprocessing(self, async_results) ->
Mapping[str, EventBu
num_process = min(len(async_results), self._sync_parallelism)
with ProcessPoolExecutor(max_workers=num_process) as sync_pool:
- chunksize = max(1, math.floor(math.ceil(1.0 * len(async_results) /
self._sync_parallelism)))
+ chunksize = max(1, math.ceil(len(async_results) /
self._sync_parallelism))
Review Comment:
I wonder why the outer `floor` existed in the first place. That wouldn’t do
anything on Python 2 either…
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]