Skip to content

Commit

Permalink
Updating unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jroach-astronomer committed Dec 18, 2024
1 parent 9a7d058 commit d5d8e68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dagfactory/dagbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion tests/test_dagbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit d5d8e68

Please sign in to comment.