You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/06/03 07:54:00 UTC

[jira] [Commented] (AIRFLOW-1156) Using a timedelta object as a Schedule Interval with catchup=False causes the start_date to no longer be honored.

    [ https://issues.apache.org/jira/browse/AIRFLOW-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17124723#comment-17124723 ] 

ASF GitHub Bot commented on AIRFLOW-1156:
-----------------------------------------

marclamberti commented on pull request #8776:
URL: https://github.com/apache/airflow/pull/8776#issuecomment-638026993


   Oh that's funny because I struggled a lot on this to understand why there was a difference between the cron expressions and timdelta. That's why I started to use CRON instead. Didn't think it was a bug and very happy to know it solved :)


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Using a timedelta object as a Schedule Interval with catchup=False causes the start_date to no longer be honored.
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-1156
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1156
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: scheduler
>    Affects Versions: 1.8.0
>            Reporter: Zachary Lawson
>            Assignee: Kaxil Naik
>            Priority: Minor
>             Fix For: 1.10.11
>
>
> Currently, in Airflow v1.8, if you set your schedule_interval to a timedelta object and set catchup=False, the start_date is no longer honored and the DAG is scheduled immediately upon unpausing the DAG. It is then schedule on the schedule interval from that point onward. Example below:
> {code}
> from airflow import DAG
> from datetime import datetime, timedelta
> import logging
> from airflow.operators.python_operator import PythonOperator
> default_args = {
>     'owner': 'airflow',
>     'depends_on_past': False,
>     'start_date': datetime(2015, 6, 1),
> }
> dag = DAG('test', default_args=default_args, schedule_interval=timedelta(seconds=5), catchup=False)
> def context_test(ds, **context):
>     logging.info('testing')
> test_context = PythonOperator(
>     task_id='test_context',
>     provide_context=True,
>     python_callable=context_test,
>     dag=dag
> )
> {code}
> If you switch the above over to a CRON expression, the behavior of the scheduling is returned to the expected.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)