ashb commented on code in PR #46265:
URL: https://github.com/apache/airflow/pull/46265#discussion_r1935136163


##########
providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py:
##########
@@ -125,21 +130,54 @@ def on_celery_import_modules(*args, **kwargs):
         import kubernetes.client  # noqa: F401
 
 
[email protected]
-def execute_command(command_to_exec: CommandType) -> None:
-    """Execute command."""
-    dag_id, task_id = 
BaseExecutor.validate_airflow_tasks_run_command(command_to_exec)
+# Once Celery5 is out of beta, we can pass `pydantic=True` to the decorator 
and it will handle the validation
+# and deserialization for us
[email protected](name="execute_workload")
+def execute_workload(input: str) -> None:
+    from pydantic import TypeAdapter
+
+    from airflow.configuration import conf
+    from airflow.executors import workloads
+    from airflow.sdk.execution_time.supervisor import supervise
+
+    decoder = TypeAdapter(workloads.All)
+    workload = decoder.validate_json(input)

Review Comment:
   I don't think so - we want it to fail so I don't know what we'd put in the 
except block other than raise



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

Reply via email to