dsuhinin commented on code in PR #62174:
URL: https://github.com/apache/airflow/pull/62174#discussion_r2927374178


##########
task-sdk/tests/task_sdk/bases/test_decorator.py:
##########
@@ -69,6 +70,208 @@ def 
test_get_python_source_strips_decorator_and_comment(self, tmp_path: Path):
         assert cleaned.lstrip().splitlines()[0].startswith("def a_task")
 
 
+class DummyDecoratedOperator(DecoratedOperator):
+    custom_operator_name = "@task.dummy"
+
+    def execute(self, context):
+        return self.python_callable(*self.op_args, **self.op_kwargs)
+
+
+class TestDefaultFillingLogic:
+    @pytest.mark.parametrize(
+        ("func", "kwargs", "args"),
+        [
+            pytest.param(
+                lambda: 42,
+                {},
+                [],
+                id="no_params",
+            ),
+            pytest.param(
+                lambda a, b=5, c=None: (a, b, c),
+                {"a": 1},
+                [],
+                id="param_after_first_default_without_default",
+            ),
+            pytest.param(
+                lambda x, y=99: (x, y),
+                {"x": 1},
+                [],
+                id="param_after_first_default_is_given_none",
+            ),
+            pytest.param(
+                lambda a, b, c=99: (a, b, c),
+                {},
+                [1, 2],
+                id="single_trailing_optional",
+            ),
+        ],
+    )
+    def test_construction_succeeds(self, func, kwargs, args):
+        op = make_op(func, op_kwargs=kwargs, op_args=args)
+        assert op is not None
+
+    @pytest.mark.parametrize(
+        ("func", "op_kwargs", "op_args", "expected_defaults"),
+        [
+            pytest.param(
+                lambda a, b, c: a + b + c,
+                {},
+                [1, 2, 3],
+                [inspect.Parameter.empty, inspect.Parameter.empty, 
inspect.Parameter.empty],
+                id="all_required_no_defaults_injected",
+            ),
+            pytest.param(
+                lambda required, optional=10: required + optional,
+                {"required": 5},
+                [],
+                [inspect.Parameter.empty, 10],
+                id="params_before_first_default_stay_required",
+            ),
+            pytest.param(
+                lambda a, b=1, c=2, d=3: a + b + c + d,
+                {"a": 10},
+                [],
+                [inspect.Parameter.empty, 1, 2, 3],
+                id="explicit_defaults_after_first_default_preserved",
+            ),
+            pytest.param(
+                lambda no_default_1, no_default_2, first_default=42, 
after=None: None,
+                {},
+                [1, 2],
+                [inspect.Parameter.empty, inspect.Parameter.empty, 42, None],
+                id="first_default_defines_boundary",
+            ),
+            pytest.param(
+                lambda a=1, b=2, c=3: a + b + c,
+                {},
+                [],
+                [1, 2, 3],
+                id="all_params_have_defaults_none_overwritten",
+            ),
+        ],
+    )
+    def test_param_defaults(self, func, op_kwargs, op_args, expected_defaults):
+        op = make_op(func, op_kwargs=op_kwargs, op_args=op_args)
+        sig = inspect.signature(op.python_callable)

Review Comment:
   remove this tests for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to