dsuhinin commented on code in PR #62174:
URL: https://github.com/apache/airflow/pull/62174#discussion_r2956012590
##########
task-sdk/tests/task_sdk/bases/test_decorator.py:
##########
@@ -69,6 +69,160 @@ 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",
Review Comment:
ook, if I understood you correctly we even don't need this test. In general
I can't use:
```
lambda a, b=5, c: (a, b, c)
```
because it isn't a valid Python syntax to have `c` as a required parameter
after default `b`. If I understood you correctly it is enough that we already
have here:
```
pytest.param(
"def dummy_task({ctx0}, x, y=10): return (x, y)",
{"x": 42},
id="required_param_between_context_key_and_regular_default_gets_none",
)
```
so `x` will be assigned as `None` after a `context` key. Please let me know
if Im wrong.
--
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]