This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ac8d9474319 Remove duplicate tests in Task SDK (#68504)
ac8d9474319 is described below
commit ac8d947431931921d5186ea99a71e3956458fea9
Author: Shahar Epstein <[email protected]>
AuthorDate: Sat Jul 4 13:45:56 2026 +0300
Remove duplicate tests in Task SDK (#68504)
---
.../tests/task_sdk/definitions/test_taskgroup.py | 52 ----------------------
.../tests/task_sdk/execution_time/test_comms.py | 10 -----
2 files changed, 62 deletions(-)
diff --git a/task-sdk/tests/task_sdk/definitions/test_taskgroup.py
b/task-sdk/tests/task_sdk/definitions/test_taskgroup.py
index d11f8eb3632..485346d6d28 100644
--- a/task-sdk/tests/task_sdk/definitions/test_taskgroup.py
+++ b/task-sdk/tests/task_sdk/definitions/test_taskgroup.py
@@ -272,40 +272,6 @@ def test_taskgroup_getitem_returns_child_by_label(prefix:
bool):
group1["nonexistent"]
-def test_build_task_group_with_prefix_functionality():
- """
- Tests TaskGroup prefix_group_id functionality - additional test for
comprehensive coverage.
- """
- logical_date = pendulum.parse("20200101")
- with DAG("test_prefix_functionality", start_date=logical_date):
- task1 = EmptyOperator(task_id="task1")
- with TaskGroup("group234", prefix_group_id=False) as group234:
- task2 = EmptyOperator(task_id="task2")
-
- with TaskGroup("group34") as group34:
- task3 = EmptyOperator(task_id="task3")
-
- with TaskGroup("group4", prefix_group_id=False) as group4:
- task4 = EmptyOperator(task_id="task4")
-
- task5 = EmptyOperator(task_id="task5")
- task1 >> group234
- group34 >> task5
-
- # Test prefix_group_id behavior
- assert task2.task_id == "task2" # prefix_group_id=False, so no prefix
- assert group34.group_id == "group34" # nested group gets prefixed
- assert task3.task_id == "group34.task3" # task in nested group gets full
prefix
- assert group4.group_id == "group34.group4" # nested group gets parent
prefix
- assert task4.task_id == "task4" # prefix_group_id=False, so no prefix
- assert task5.task_id == "task5" # root level task, no prefix
-
- # Test group hierarchy and child access
- assert group234.get_child_by_label("task2") == task2
- assert group234.get_child_by_label("group34") == group34
- assert group4.get_child_by_label("task4") == task4
-
-
def test_build_task_group_with_task_decorator():
"""
Test that TaskGroup can be used with the @task decorator.
@@ -579,24 +545,6 @@ def test_iter_tasks():
]
-def test_override_dag_default_args():
- logical_date = pendulum.parse("20201109")
- with DAG(
- dag_id="example_task_group_default_args",
- schedule=None,
- start_date=logical_date,
- default_args={"owner": "dag"},
- ):
- with TaskGroup("group1", default_args={"owner": "group"}):
- task_1 = EmptyOperator(task_id="task_1")
- task_2 = EmptyOperator(task_id="task_2", owner="task")
- task_3 = EmptyOperator(task_id="task_3", default_args={"owner":
"task"})
-
- assert task_1.owner == "group"
- assert task_2.owner == "task"
- assert task_3.owner == "task"
-
-
def test_override_dag_default_args_in_nested_tg():
logical_date = pendulum.parse("20201109")
with DAG(
diff --git a/task-sdk/tests/task_sdk/execution_time/test_comms.py
b/task-sdk/tests/task_sdk/execution_time/test_comms.py
index 97b9a79931f..aa7264b8750 100644
--- a/task-sdk/tests/task_sdk/execution_time/test_comms.py
+++ b/task-sdk/tests/task_sdk/execution_time/test_comms.py
@@ -61,16 +61,6 @@ class TestCommsModels:
mask_secret_object = MaskSecret(value=object_to_mask,
name="test_secret")
assert mask_secret_object.value == object_to_mask
- def test_mask_secret_with_list(self):
- example_dict = ["test"]
- mask_secret_object = MaskSecret(value=example_dict, name="test_secret")
- assert mask_secret_object.value == example_dict
-
- def test_mask_secret_with_iterable(self):
- example_dict = ["test"]
- mask_secret_object = MaskSecret(value=example_dict, name="test_secret")
- assert mask_secret_object.value == example_dict
-
class TestCommsDecoder:
"""Test the communication between the subprocess and the "supervisor"."""