ferruzzi commented on code in PR #61153:
URL: https://github.com/apache/airflow/pull/61153#discussion_r2748549870
##########
providers/celery/src/airflow/providers/celery/executors/celery_executor.py:
##########
@@ -139,17 +140,31 @@ def _process_tasks(self, task_tuples:
Sequence[TaskTuple]) -> None:
def _process_workloads(self, workloads: Sequence[workloads.All]) -> None:
# Airflow V3 version -- have to delay imports until we know we are on
v3
- from airflow.executors.workloads import ExecuteTask
+ from airflow.executors.workloads import ExecuteCallback, ExecuteTask
Review Comment:
Yeah, for sure, good catch. I can do a soft test like :
```
if isinstance(workload, ExecuteTask):
# handle task
elif type(workload).__name__ == "ExecuteCallback":
# Import only if callback found
from airflow.executors.workloads import ExecuteCallback
```
or a hard gate like
```
def _process_workloads(self, workloads):
from airflow.executors.workloads import ExecuteTask
if AIRFLOW_V_3_2_PLUS:
from airflow.executors.workloads import ExecuteCallback
```
The first option feels better, but the second looks more explicit. Any
preference?
--
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]