deepujain commented on code in PR #69157:
URL: https://github.com/apache/airflow/pull/69157#discussion_r3746794343


##########
task-sdk/src/airflow/sdk/bases/decorator.py:
##########
@@ -253,6 +253,16 @@ def determine_kwargs(
     return KeywordParameters.determine(func, args, kwargs).unpacking()
 
 
+_TASK_DECORATOR_CALL_HINT = (
+    "This can happen when a @task-decorated function shadows another callable 
and the decorated task "
+    "object is called like a regular function. Rename the task function or 
call the original callable instead."
+)
+
+
+def _should_add_task_decorator_call_hint(err: TypeError, op_args: 
Collection[Any]) -> bool:
+    return bool(op_args) and "too many positional arguments" in str(err)

Review Comment:
   Agreed. I narrowed the check so it inspects the stack only after binding 
fails and adds the hint only when the underlying callable is already executing. 
A direct arity mistake such as `dummy_task(1, 2)` now keeps the original error; 
Ruff and all three targeted regression tests pass.
   
   ---
   Drafted-by: OpenAI Codex (no human review before posting)



-- 
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