This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit e2086f4b186325a700ccaa5d4274542349da2c57
Author: Jed Cunningham <[email protected]>
AuthorDate: Mon May 20 16:56:29 2024 -0600

    More typing in TimeSensor and TimeSensorAsync (#39696)
    
    (cherry picked from commit f509b0a9245277a8442f42b46ca755e8f9d25cfc)
---
 airflow/sensors/time_sensor.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/airflow/sensors/time_sensor.py b/airflow/sensors/time_sensor.py
index cc07323ca1..6df67bc855 100644
--- a/airflow/sensors/time_sensor.py
+++ b/airflow/sensors/time_sensor.py
@@ -40,11 +40,11 @@ class TimeSensor(BaseSensorOperator):
 
     """
 
-    def __init__(self, *, target_time, **kwargs):
+    def __init__(self, *, target_time: datetime.time, **kwargs) -> None:
         super().__init__(**kwargs)
         self.target_time = target_time
 
-    def poke(self, context: Context):
+    def poke(self, context: Context) -> bool:
         self.log.info("Checking if the time (%s) has come", self.target_time)
         return timezone.make_naive(timezone.utcnow(), 
self.dag.timezone).time() > self.target_time
 
@@ -62,7 +62,7 @@ class TimeSensorAsync(BaseSensorOperator):
         :ref:`howto/operator:TimeSensorAsync`
     """
 
-    def __init__(self, *, target_time, **kwargs):
+    def __init__(self, *, target_time: datetime.time, **kwargs) -> None:
         super().__init__(**kwargs)
         self.target_time = target_time
 
@@ -79,6 +79,6 @@ class TimeSensorAsync(BaseSensorOperator):
             method_name="execute_complete",
         )
 
-    def execute_complete(self, context, event=None):
+    def execute_complete(self, context, event=None) -> None:
         """Execute when the trigger fires - returns immediately."""
         return None

Reply via email to