Prab-27 commented on code in PR #57563:
URL: https://github.com/apache/airflow/pull/57563#discussion_r2480317107


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py:
##########
@@ -569,7 +574,7 @@ def try_adopt_task_instances(self, tis: 
Sequence[TaskInstance]) -> Sequence[Task
             tis_to_flush_by_key = {ti.key: ti for ti in tis if 
ti.queued_by_job_id}
             kube_client: client.CoreV1Api = self.kube_client
             for scheduler_job_id in scheduler_job_ids:
-                scheduler_job_id = 
self._make_safe_label_value(str(scheduler_job_id))
+                scheduler_job_id = cast("int", 
self._make_safe_label_value(str(scheduler_job_id)))

Review Comment:
   here , 
   ```
   def try_adopt_task_instances(self, tis: Sequence[TaskInstance]) -> 
Sequence[TaskInstance]:
           with 
Stats.timer("kubernetes_executor.adopt_task_instances.duration"):
               # Always flush TIs without queued_by_job_id
               tis_to_flush = [ti for ti in tis if not ti.queued_by_job_id]
               scheduler_job_ids = {ti.queued_by_job_id for ti in tis}
               tis_to_flush_by_key = {ti.key: ti for ti in tis if 
ti.queued_by_job_id}
               kube_client: client.CoreV1Api = self.kube_client
               for scheduler_job_id in scheduler_job_ids:
                   scheduler_job_id = 
self._make_safe_label_value(str(scheduler_job_id))
   ```
   
   shows
   ```
    
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py:577:
 error:
     Incompatible types in assignment (expression has type "str", variable has 
type
     "int | None")  [assignment]
                         scheduler_job_id = 
self._make_safe_label_value(str(sch...
   ```



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