Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
SapphicCode opened this issue Aug 9, 2023 · 2 comments · Fixed by #33406
Closed
2 tasks done

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

SapphicCode opened this issue Aug 9, 2023 · 2 comments · Fixed by #33406
Assignees
Labels
affected_version:2.6 Issues Reported for 2.6 area:core area:core-operators Operators, Sensors and hooks within Core Airflow kind:bug This is a clearly a bug

Comments

@SapphicCode
Copy link
Contributor

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

@SapphicCode SapphicCode added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Aug 9, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 9, 2023

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@potiuk
Copy link
Member

potiuk commented Aug 10, 2023

assigned you. Feel free to make PR.

@nathadfield nathadfield added area:core-operators Operators, Sensors and hooks within Core Airflow and removed needs-triage label for new issues that we didn't triage yet labels Aug 14, 2023
@eladkal eladkal added the affected_version:2.6 Issues Reported for 2.6 label Aug 18, 2023
SapphicCode added a commit to SapphicCode/fork-airflow that referenced this issue Sep 5, 2023
potiuk pushed a commit that referenced this issue Oct 12, 2023
* fix(TimeSensorAsync): use DAG timezone

Fixes: #33256
ephraimbuddy pushed a commit that referenced this issue Oct 29, 2023
* fix(TimeSensorAsync): use DAG timezone

Fixes: #33256
(cherry picked from commit 6c50ef5)
ephraimbuddy pushed a commit that referenced this issue Oct 30, 2023
* fix(TimeSensorAsync): use DAG timezone

Fixes: #33256
(cherry picked from commit 6c50ef5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:2.6 Issues Reported for 2.6 area:core area:core-operators Operators, Sensors and hooks within Core Airflow kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants