potiuk commented on a change in pull request #10499:
URL: https://github.com/apache/airflow/pull/10499#discussion_r475858811



##########
File path: airflow/models/taskinstance.py
##########
@@ -1135,23 +1134,16 @@ def _run_raw_task(
             session.merge(self)
         session.commit()
 
-    def _prepare_and_execute_task_with_callbacks(self, context, session, task):
+    def _prepare_and_execute_task_with_callbacks(
+            self,
+            context,
+            task):
         """
         Prepare Task for Execution
         """
-        from airflow.models.renderedtifields import RenderedTaskInstanceFields 
as RTIF
-        from airflow.sensors.base_sensor_operator import BaseSensorOperator
+        from airflow.models.renderedtifields import RenderedTaskInstanceFields
 
         task_copy = task.prepare_for_execution()
-        # Sensors in `poke` mode can block execution of DAGs when running
-        # with single process executor, thus we change the mode to`reschedule`
-        # to allow parallel task being scheduled and executed
-        if (
-            isinstance(task_copy, BaseSensorOperator) and

Review comment:
       Hey @turbaszek -> I think that was the root cause for the cyclic import 
but it should be hopefully fixed now (at least SkipMixin -> TaskInstance -> 
BaseSensorOperator -> SkipMixin).
   
   The solution was overloading prepare_for_execution method in 
BaseSensorOperator (seems also the right thing to do) but I would love you to 
take a look as well.
   
   




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to