You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/09 21:34:40 UTC
[GitHub] [airflow] thelastmessiha opened a new issue, #24359: Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC
thelastmessiha opened a new issue, #24359:
URL: https://github.com/apache/airflow/issues/24359
### Apache Airflow version
2.2.5
### What happened
I've set the core default_timezone and default_ui_timezone values to America/Los_Angeles which successfully makes the scheduler respect the local Pacific timezone, however, when I create a task using the DateTimeSensor in a dag with schedule_interval='@daily' and would like that particular task to wait until 3am Pacific using the below code, it still appears to be using UTC rather than Pacific and completes as soon as it's scheduled, at midnight Pacific, rather than waiting until 3am Pacific. I believe this is happening at midnight Pacific because the dag itself is bound by the schedule_interval='@daily' which is in Pacific time and when it checks if it's 3am UTC yet, it evaluates to the past and executes.
start = DateTimeSensor(
task_id='start',
target_time='{{ data_interval_end.replace(hour=3) }}',
dag=dag,
)
One way to get this working as expected is to change it to the following, which explicitly specifies the timezone, but this is tedious as it would need to be used everywhere and I'd like to be able to develop all dags without having to think about timezone since everything is Pacific timezone-based:
start = DateTimeSensor(
task_id='start',
target_time='{{ data_interval_end.replace(tzinfo="America/Los_Angeles", hour=3) }}',
# timeout=1500,
dag=dag,
)
### What you think should happen instead
I think it makes sense to automatically make all behaviors related to timezone match the scheduler's timezone unless otherwise explicitly specified.
### How to reproduce
set the core default_timezone and default_ui_timezone values to America/Los_Angeles.
Observe the tasks executions and note the time that the DateTimeSensors are completing.
### Operating System
Ubuntu 18.04.6 LTS (Bionic Beaver)
### Versions of Apache Airflow Providers
composer-1.18.11-airflow-2.2.5 (provided by Google, GCP Composer)
### Deployment
Composer
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #24359: Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #24359:
URL: https://github.com/apache/airflow/issues/24359#issuecomment-1159815411
I think there are currently a few timezone behaviours that @bbovenzi and @uranusjr and @ephraimbuddy are handling - I am not sure if the current proposal falls into it and how consistency would be applided but those seem to be related #24373 #17131 #21171 #23796 for example.
--
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
Re: [I] Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #24359:
URL: https://github.com/apache/airflow/issues/24359#issuecomment-1945474037
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
--
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
Re: [I] Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #24359:
URL: https://github.com/apache/airflow/issues/24359#issuecomment-2036344466
This issue has been closed because it has not received response from the issue author.
--
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
[GitHub] [airflow] boring-cyborg[bot] commented on issue #24359: Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #24359:
URL: https://github.com/apache/airflow/issues/24359#issuecomment-1151647426
Thanks for opening your first issue here! Be sure to follow the issue template!
--
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
Re: [I] Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #24359: Timezone changed on server and UI to local/Pacific, but DateTimeSensor still using UTC
URL: https://github.com/apache/airflow/issues/24359
--
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