You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TimeSensorAsync fails with the following error if target_time is aware:
[2022-06-29, 05:09:11 CDT] {taskinstance.py:1889} ERROR - Task failed with exception
Traceback (most recent call last):
File "/opt/conda/envs/production/lib/python3.9/site-packages/airflow/sensors/time_sensor.py", line 60, in execute
trigger=DateTimeTrigger(moment=self.target_datetime),
File "/opt/conda/envs/production/lib/python3.9/site-packages/airflow/triggers/temporal.py", line 42, in __init__
raise ValueError(f"The passed datetime must be using Pendulum's UTC, not {moment.tzinfo!r}")
ValueError: The passed datetime must be using Pendulum's UTC, not Timezone('America/Chicago')
What you think should happen instead
Given the fact that TimeSensor correctly handles timezones (#9882), this seems like a bug. TimeSensorAsync should be a drop-in replacement for TimeSensor, and therefore should have the same timezone behavior.
Convert to a feature since not allowing non-UTC is an explicit design choice made in the current implementation. Need some context on this to decide what best to do here @andrewgodwin
I don't see a problem with adding timezone conversion code to convert it to UTC at call time - I just add UTC-only checks to all timezone items by default if I didn't specifically write timezone support, so there's a nice clean error rather than weird behaviour.
Apache Airflow version
2.3.2 (latest released)
What happened
TimeSensorAsync
fails with the following error iftarget_time
is aware:What you think should happen instead
Given the fact that
TimeSensor
correctly handles timezones (#9882), this seems like a bug.TimeSensorAsync
should be a drop-in replacement forTimeSensor
, and therefore should have the same timezone behavior.How to reproduce
This can also happen if the
target_time
is naive andcore.default_timezone = system
.Operating System
CentOS Stream 8
Versions of Apache Airflow Providers
N/A
Deployment
Other
Deployment details
Standalone
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: