From d5d8e6899110e34a5e06ea123b57714987b8f672 Mon Sep 17 00:00:00 2001 From: jroach-astronomer Date: Tue, 17 Dec 2024 23:47:13 -0500 Subject: [PATCH] Updating unit-tests --- dagfactory/dagbuilder.py | 7 ++++--- tests/test_dagbuilder.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dagfactory/dagbuilder.py b/dagfactory/dagbuilder.py index c78152a..0b251e3 100644 --- a/dagfactory/dagbuilder.py +++ b/dagfactory/dagbuilder.py @@ -479,15 +479,16 @@ def _init_task_group_callback_param(task_group_conf): :param task_group_conf: dict containing the configuration of the TaskGroup """ - # The Airflow version needs to be at least 2.2.0, and default args must be present + # The Airflow version needs to be at least 2.2.0, and default args must be present. Basically saying here: if + # it's not the case that we're using at least Airflow 2.2.0 and default_args are present, then return the + # TaskGroup configuration without doing anything if not ( version.parse(AIRFLOW_VERSION) >= version.parse("2.2.0") and isinstance(task_group_conf.get("default_args"), dict) ): + print(f"{'*' * 20} MADE IT HERE {'*' * 20}") return task_group_conf - print(f"{'*' * 20} MADE IT HERE {'*' * 20}") - # Check the callback types that can be in the default_args of the TaskGroup for callback_type in [ "on_success_callback", diff --git a/tests/test_dagbuilder.py b/tests/test_dagbuilder.py index e4f2707..e1538bf 100644 --- a/tests/test_dagbuilder.py +++ b/tests/test_dagbuilder.py @@ -798,7 +798,6 @@ def test_dag_with_task_group_callbacks_default_args(): # Test that the on_execute_callback configured in the default_args of the TaskGroup are passed down to the Tasks # grouped into task_group_1 assert "on_execute_callback" in task_group_default_args and "on_failure_callback" in task_group_default_args - print(dag.task_dict["task_group_1.task_1"].__dict__) assert callable(dag.task_dict["task_group_1.task_1"].on_execute_callback) assert dag.task_dict["task_group_1.task_1"].on_execute_callback.__name__ == "print_context_callback"