Lee-W commented on code in PR #50864:
URL: https://github.com/apache/airflow/pull/50864#discussion_r2099452302
##########
providers/standard/src/airflow/providers/standard/sensors/time.py:
##########
@@ -96,36 +71,40 @@ class TimeSensorAsync(BaseSensorOperator):
)
start_from_trigger = False
- def __init__(
- self,
- *,
- target_time: datetime.time,
- start_from_trigger: bool = False,
- trigger_kwargs: dict[str, Any] | None = None,
- end_from_trigger: bool = False,
- **kwargs,
- ) -> None:
+ def __init__(self, *, target_time: datetime.time, deferrable: bool =
False, **kwargs) -> None:
super().__init__(**kwargs)
- self.start_from_trigger = start_from_trigger
- self.end_from_trigger = end_from_trigger
- self.target_time = target_time
+ # Create a "date-aware" timestamp that will be used as the
"target_datetime". This is a requirement
+ # of the DateTimeTrigger
aware_time = timezone.coerce_datetime(
- datetime.datetime.combine(datetime.datetime.today(),
self.target_time, self.dag.timezone)
+ datetime.datetime.combine(datetime.datetime.today(), target_time,
self.dag.timezone)
)
+ # Now that the DAG's timezone has made the datetime timezone aware, we
need to convert to UTC
Review Comment:
```suggestion
# Now that the dag's timezone has made the datetime timezone aware,
we need to convert to UTC
```
--
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]