dabla commented on code in PR #55068:
URL: https://github.com/apache/airflow/pull/55068#discussion_r2718092354


##########
providers/google/src/airflow/providers/google/cloud/triggers/dataproc.py:
##########
@@ -153,23 +156,27 @@ def get_task_instance(self, session: Session) -> 
TaskInstance:
     async def get_task_state(self):
         from airflow.sdk.execution_time.task_runner import RuntimeTaskInstance
 
-        task_states_response = await 
sync_to_async(RuntimeTaskInstance.get_task_states)(
-            dag_id=self.task_instance.dag_id,
-            task_ids=[self.task_instance.task_id],
-            run_ids=[self.task_instance.run_id],
-            map_index=self.task_instance.map_index,
-        )
-        try:
-            task_state = 
task_states_response[self.task_instance.run_id][self.task_instance.task_id]
-        except Exception:
-            raise AirflowException(
-                "TaskInstance with dag_id: %s, task_id: %s, run_id: %s and 
map_index: %s is not found",
-                self.task_instance.dag_id,
-                self.task_instance.task_id,
-                self.task_instance.run_id,
-                self.task_instance.map_index,
+        if not self.task_instance:
+            raise AirflowException(f"TaskInstance not set on 
{self.__class__.__name__}!")
+
+        if not isinstance(self.task_instance, RuntimeTaskInstance):

Review Comment:
   I reverted those changes as those are actually not really a part of this PR.



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