Skip to content

Commit

Permalink
Added callback_file & callback_name to default_args DAG level and tes…
Browse files Browse the repository at this point in the history
…ts: fmt-check
  • Loading branch information
subbota19 committed Sep 20, 2024
1 parent 173f69a commit 5f44816
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dagfactory/dagbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,27 @@ def get_dag_params(self) -> Dict[str, Any]:
if utils.check_dict_key(
dag_params["default_args"], "on_success_callback_name"
) and utils.check_dict_key(
dag_params["default_args"], "on_success_callback_file"):
dag_params["default_args"], "on_success_callback_file"
):

dag_params["default_args"]["on_success_callback"]: Callable = utils.get_python_callable(
dag_params["default_args"]["on_success_callback_name"],
dag_params["default_args"]["on_success_callback_file"],
dag_params["default_args"]["on_success_callback"]: Callable = (
utils.get_python_callable(
dag_params["default_args"]["on_success_callback_name"],
dag_params["default_args"]["on_success_callback_file"],
)
)

if utils.check_dict_key(
dag_params["default_args"], "on_failure_callback_name"
) and utils.check_dict_key(
dag_params["default_args"], "on_failure_callback_file"):
dag_params["default_args"], "on_failure_callback_file"
):

dag_params["default_args"]["on_failure_callback"]: Callable = utils.get_python_callable(
dag_params["default_args"]["on_failure_callback_name"],
dag_params["default_args"]["on_failure_callback_file"],
dag_params["default_args"]["on_failure_callback"]: Callable = (
utils.get_python_callable(
dag_params["default_args"]["on_failure_callback_name"],
dag_params["default_args"]["on_failure_callback_file"],
)
)

if utils.check_dict_key(dag_params, "template_searchpath"):
Expand Down

0 comments on commit 5f44816

Please sign in to comment.