astronomer / dag-factory

Dynamically generate Apache Airflow DAGs from YAML configuration files
Apache License 2.0
1.21k stars 183 forks source link

sla_miss_callback #112

Open deepakjindal90 opened 3 years ago

deepakjindal90 commented 3 years ago

sla_miss_callback functionality should be like below

    if utils.check_dict_key(
        dag_params, "on_success_callback_name"
    ) and utils.check_dict_key(dag_params, "on_success_callback_file"):
        dag_params["on_success_callback"]: Callable = utils.get_python_callable(
            dag_params["on_success_callback_name"],
            dag_params["on_success_callback_file"],
        )
        dag_params["default_args"]["on_success_callback"]: Callable = utils.get_python_callable(
            dag_params["on_success_callback_name"],
            dag_params["on_success_callback_file"],
        )
zohairshaikh commented 3 years ago

Try passing sla_miss_callback on the dag level, this seems to be working in my case

"dag_id":
    sla_miss_callback: module.file.func_name
    default_args:
        owner: 'airflow'
        ...