Skip to content

TimeSensorAsync does not use DAG timezone to convert naive time input #33256

@SapphicCode

Description

@SapphicCode

Apache Airflow version

2.6.3

What happened

TimeSensor and TimeSensorAsync convert timezones differently.

TimeSensor converts a naive time into an tz-aware time with self.dag.timezone. TimeSensorAsync does not, and erronously converts it to UTC instead.

What you think should happen instead

TimeSensor and TimeSensorAsync should behave the same.

How to reproduce

Compare the logic of TimeSensor versus TimeSensorAsync, given a DAG with a UTC+2 (for example Europe/Berlin) timezone and the target_time input of datetime.time(9, 0).

Operating System

Official container image, Debian GNU/Linux 11 (bullseye), Python 3.10.12

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

EKS + Kustomize stack with airflow-ui, airflow-scheduler, and airflow-triggerer.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions