-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Add support for more than 1 cron exp per DAG #8649
Comments
An immediate solution to your last sentence is to use timedelta. This is also supported: |
It's not the same. When specifying cron exp you guaranty that tasks will be fired when the time comes. If you use to explain lets use daily for simplicity: 2020-04-29 00:00:00 Now lets say that airflow was down and the run of 2020-04-29 00:00:00 started to run on 2020-04-29 04:00:00, the next run will still be on 2020-05-01 00:00:00 On the other hand with: |
Can you provide an example (screenshot/code/whatever) where that happens? As far as I know, the next execution date is always computed with the |
@BasPH
This is an example for the execution times: As you can this DAG is hourly by I'm sure you can understand that there is no business logic behind the time stamp of So as said before |
Thanks for pointing this out @jeffolsi, that indeed makes no sense and seems like a fundamental error which should be fixed. What version are you running on? Let's make a separate issue for it. Regarding the multiple cron expressions, I've seen the request multiple times and think it would be a good addition. The apscheduler library has something for combining intervals: https://apscheduler.readthedocs.io/en/stable/modules/triggers/combining.html. I think similar behaviour would be nice to integrate in Airflow too. |
@BasPH I'm running 1.10.3 I think this is a very important feature for Airflow. |
I would like to work on this. The idea would be to allow a list of cron expressions as a |
@mdediana We had long discussions about whether to support multiple scheduler intervals. Many people think that this can affect the presentation and readability of the collected data. This can also complicate the scheduler logic. Can you describe your idea on the mailing list? |
I would recommend that the user be allow to supply a list of cron strings or cron strings with comma separation. I would then implement a object that has internal logic like this implementation of scheduling with multiple |
@mik-laj Sure, I will do that, thanks. |
Is there any update on this? |
This will be of great help. Instead of creating separate DAGs for the same job (like what currently I am doing), this would reduce to just 1 DAG taking care of multiple schedules. One workaround right now is if the crons are not strict, one can tweak multiple crons to have the minutes dimension same for all, for ex : "45 0,8,13 * * *", this will run for 0045, 0845 and 1345 Hrs respectively. |
I've started a discussion thread on this on the dev mailing list to scope out what a solution to this will look like https://lists.apache.org/thread.html/rb4e004e68574e5fb77ee5b51f4fd5bfb4b3392d884c178bc767681bf%40%3Cdev.airflow.apache.org%3E Use cases there would be ace (and feedback once we come up with a design) |
I think the request as described here (bi-weekly job) is covered fully by AIP 39 already using Timetables Closing as issue solved |
Description
Allow DAG to accept list of cron expression and schedule the dag in correlation to all of them.
Similar to how it can be done in cron job
Use case / motivation
Some scheduling like: every 10 min between 16:30 to 18:10 can not be obtained with single cron expression. The idea is that DAG will have the ability to be set according to more than 1 cron but without duplicating the DAG code or the DAG entry in the UI
Even simple scheduling which is common for ETL : bi-weekly can not be done with single cron expression: https://serverfault.com/questions/404398/how-to-schedule-a-biweekly-cronjob
The text was updated successfully, but these errors were encountered: