ferruzzi commented on PR #67449: URL: https://github.com/apache/airflow/pull/67449#issuecomment-4607480829
> Hi @ferruzzi , I am still working on resolving the compatibility issue and also looking into the trade-off for the feedback ([#67449 (comment)](https://github.com/apache/airflow/pull/67449#discussion_r3300411893)) > > After creating the `CommandType` according to the ECS implementation, it seems like we need to do a `cast` on the following (`args=list(cast("Sequence[str]", command))`) and also when constructing the pod for the callback (`callback_workload = cast("ExecuteCallback", next_job.command[0])`): > > https://github.com/apache/airflow/blob/33363d541851f3017ee96f94ceb328d684ed8360/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py#L594 > > I am looking into a way if this typing can be handled a bit more better (without using `cast`), and also understanding better the dispatch logic. > > Sorry, my progress is very slow since past months due to bandwidth limit. I will try to address the the review feedback by this week. I just did a very quick look, so don't hold me to this, but I think you can make `_run_next_callback` accept the workload itself instead of the `next_job`: `def _run_next_callback(self, callback_workload: ExecuteCallback) -> None:` then in `run_next` you'd call it with `return self._run_next_callback(command[0])`. I _think_ if you do that then the typing should be handled correctly since it's going through the isinstance? Maybe? MyPy can be fickle. I think between that and adding the `list[str]` return hint to `workload_to_command_args` you should be good without casting anything. -- 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]
