I have a scenario where I've to schedule an Airflow DAG with different params based on scheduling criteria.
For instance, I've to:
Schedule DAG on Monday and Tuesday with the variable "source" as "process_usa"
Schedule DAG every Friday with the variable "source" as "process_ca"
Schedule DAG on Tuesday, Wednesday and Sunday with the variable "source" as "process_ind"
Any idea how can I do scheduling of the DAG with different params based on schedule.
There is no straightforward approach that I know of. But you can basically have a PythonOperator as the first task (or alternatively wrap your dag in another dag, if you don't want to disturb actual dag) and you should be able to handle schedule check in the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With