You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "SapphicCode (via GitHub)" <gi...@apache.org> on 2023/09/05 07:05:24 UTC
[GitHub] [airflow] SapphicCode commented on a diff in pull request #33406: fix(TimeSensorAsync): use DAG timezone
SapphicCode commented on code in PR #33406:
URL: https://github.com/apache/airflow/pull/33406#discussion_r1315459829
##########
tests/sensors/test_time_sensor.py:
##########
@@ -73,3 +73,11 @@ def test_target_time_aware(self):
op = TimeSensorAsync(task_id="test", target_time=aware_time)
assert hasattr(op.target_datetime.tzinfo, "offset")
assert op.target_datetime.tzinfo.offset == 0
+
+ def test_target_time_naive_dag_timezone(self):
Review Comment:
Done.
##########
tests/sensors/test_time_sensor.py:
##########
@@ -73,3 +73,11 @@ def test_target_time_aware(self):
op = TimeSensorAsync(task_id="test", target_time=aware_time)
assert hasattr(op.target_datetime.tzinfo, "offset")
assert op.target_datetime.tzinfo.offset == 0
+
+ def test_target_time_naive_dag_timezone(self):
+ with DAG(
+ "test_target_time_naive_dag_timezone",
+ start_date=pendulum.datetime(2020, 1, 1, 0, 0, tz=DEFAULT_TIMEZONE),
+ ):
+ op = TimeSensorAsync(task_id="test", target_time=pendulum.time(8, 0))
+ assert op.target_datetime.time() == pendulum.time(0, 0)
Review Comment:
And done.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org