alexbegg opened a new issue, #23689:
URL: https://github.com/apache/airflow/issues/23689

   ### Apache Airflow version
   
   2.2.5
   
   ### What happened
   
   When I use the date picker in the “Trigger DAG w/ config” page to choose a 
specific logical date for some reason on a daily DAG the Data Interval Start 
(circled in red) )is 2 days before the logical date (circled in blue), instead 
of the same as the logical date. And the Data Interval End is one day before 
the logical date. So the interval is the correct length, but on wrong days.
   
   ![Screen Shot 2022-05-11 at 5 14 10 
PM](https://user-images.githubusercontent.com/45696489/168159891-b080273b-4b22-4ef8-a2ae-98327a503f9f.png)
   
   I encountered this with a DAG with a daily schedule which typically runs at 
09:30 UTC. I am testing this in a dev environment (with catchup off) and trying 
to trigger a run for 2022-05-09 09:30:00. I would expect the data interval to 
start at that same time and the data interval end to be 1 day after.
   
   It has nothing to do with the previous run since that was way back on 
2022-04-26
   
   ### What you think should happen instead
   
   The data interval start date should be the same as the data interval start 
date
   
   ### How to reproduce
   
   I made a sample DAG as shown below:
   ```python
   import pendulum
   from airflow.models import DAG
   from airflow.operators.python import PythonOperator
   
   
   def sample(data_interval_start, data_interval_end):
       return "data_interval_start: {}, data_interval_end: 
{}".format(str(data_interval_start), str(data_interval_end))
   
   
   args = {
       'start_date': pendulum.datetime(2022, 3, 10, 9, 30)
   }
   with DAG(
       dag_id='sample_data_interval_issue',
       default_args=args,
       schedule_interval='30 9 * * *'  # 09:30 UTC
   ) as sample_data_interval_issue:
       task = PythonOperator(
           task_id='sample',
           python_callable=sample
       )
   
   ```
   
   I then start it to start a scheduled DAG run (`2022-05-11, 09:30:00 UTC`), 
and the `data_interval_start` is the same as I expect, 
`2022-05-11T09:30:00+00:00`.
   
   However, when I went to "Trigger DAG w/ config" page and in the date chooser 
choose `2022-05-09 09:30:00+00:00`, and then triggered that. It shows the run 
datetime is `2022-05-09, 09:30:00 UTC`, but the `data_interval_start` is 
incorrectly set to `2022-05-08T09:30:00+00:00`, 2 days before the date I choose.
   
   ### Operating System
   
   Debian GNU/Linux 11 (bullseye)
   
   ### Versions of Apache Airflow Providers
   
   N/A
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to