question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to better support odd scheduling time

See original GitHub issue

Description

So I have been encountering odd time schedule request recently, say some updates need to be done on every second and third Friday each month, 4pm.

Tried to search for solution but could not find a perfect ones, I can think of the following solutions:

  1. use a cron and a separate DAG
  2. embed trigger in the actual task logic, that is to check whether the code should be executed in that date, otherwise return success (equivalent to skip and mark success)

Drawbacks (at least the one i can think of):

  1. it creates extra DAG, and when you have a bunch of these requests, it’s not really clean. Besides, you need to add equal number of ExternalTaskSensor to preserve inter-DAG dependencies. It also however, will need to provision other dependent resources (such as Kafka consumers)

  2. not very generic and reusable apparently, and if you are going for a full containerized solution - each Task is executed in container - you also need to start a container first to reach that simple if-else check, which seems a bit wasteful

Use case / motivation

Basically I have a bunch of extraction scripts that need to be executed at very different and very weird times, very straight forward (?), without the need to replicating provision tasks, too many inter-DAG dependencies

Potential solutions I have in mind:

  • not touching Airflow core (workaround)

inherit and extend the Operators i am using - troublesome and needs to repeat for multiple operators

  • touching Airflow core

an extra tuple params allowed_dates passed into the operators (BaseOperator), and then inject the date check right before the operator execution, essentially giving all operator the ability to be programmatically skipped in any DAG - might be an overkill

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eladkalcommented, Jul 7, 2022

Please check Timetables https://airflow.apache.org/docs/apache-airflow/stable/concepts/timetable.html If a specific feature is missing you can open a new issue and explain

1reaction
ashbcommented, Jan 20, 2021

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<dev.airflow.apache.org>

Use cases there would be ace (and feedback once we come up with a design)

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 Key Tips for Using Visual Schedules to Improve Children's ...
Once the schedule is created, review it thoroughly with the child(ren) to the best of their ability to ensure understanding.
Read more >
Oppositional Defiant Disorder - School of Education
This empowers the child. For younger children, a picture schedule may be most effective. Cue students into how much time they have left...
Read more >
Oppositional defiant disorder (ODD) - Diagnosis and treatment
Build in time together by developing a consistent weekly schedule that involves you and your child spending time together. Work together with ...
Read more >
Unpredictable work hours and volatile incomes are long-term ...
Irregular work hours and “just-in-time” scheduling practices put workers in a vulnerable financial position.
Read more >
What Is ODD in Kids? What Teachers Need To Know
What is ODD in kids, and how can teachers help their students with ODD ... For instance, give them the ability to earn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found