rawwar commented on code in PR #44518:
URL: https://github.com/apache/airflow/pull/44518#discussion_r1864703910


##########
airflow/sensors/base.py:
##########
@@ -239,7 +211,8 @@ def poke(self, context: Context) -> bool | PokeReturnValue:
         """Override when deriving this class."""
         raise AirflowException("Override me.")
 
-    def execute(self, context: Context) -> Any:
+    @provide_session
+    def execute(self, context: Context, session=NEW_SESSION) -> Any:

Review Comment:
   adding additional arg `session` is causing lot of mypy failures in providers 
where `BaseSensorOperator` is being extended.  Error's something like this:
   
   ```
   providers/src/airflow/providers/microsoft/azure/sensors/data_factory.py:98: 
error:
   Signature of "execute" incompatible with supertype "BaseSensorOperator" 
   [override]
           def execute(self, context: Context) -> None:
           ^
   providers/src/airflow/providers/microsoft/azure/sensors/data_factory.py:98: 
note:      Superclass:
   providers/src/airflow/providers/microsoft/azure/sensors/data_factory.py:98: 
note:          def execute(context: Context, session: Any = ...) -> Any
   providers/src/airflow/providers/microsoft/azure/sensors/data_factory.py:98: 
note:      Subclass:
   providers/src/airflow/providers/microsoft/azure/sensors/data_factory.py:98: 
note:          def execute(self, context: Context) -> None
   ```
   
   Should we just remove the decorator instead of updating execute method 
signature here?
   
   Failing checks: 
https://github.com/apache/airflow/actions/runs/12101035549/job/33740515392?pr=44510



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