I'd like to pass other arguments to my on_failure_callback function but it only seems to want "context". How do I pass other arguments to that function...especially since I'd like to define that function in a separate module so it can be used in all my DAGS.
My current default_args looks like this:
default_args = {
'owner': 'Me',
'depends_on_past': True,
'start_date': datetime(2016,01,01),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=1),
'on_failure_callback': notify_failure,
'max_active_runs': 1
}
If I try something like this airflow complains:
default_args = {
'owner': 'Me',
'depends_on_past': True,
'start_date': datetime(2016,01,01),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=1),
'on_failure_callback': notify_failure(context,arg1,arg2),
'max_active_runs': 1
}
so not sure how to pass arg1 and arg2 to my notify_failure fuction that I would like to define in a separate module that I can simply import into my DAG