Reputation: 61
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.
Upvotes: 3
Views: 1536
Reputation: 179
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.
Upvotes: 3