uranusjr commented on code in PR #38015:
URL: https://github.com/apache/airflow/pull/38015#discussion_r1521948279
##########
airflow/decorators/base.py:
##########
@@ -208,11 +208,35 @@ def __init__(
# since values for those will be provided when the task is run. Since
# we're not actually running the function, None is good enough here.
signature = inspect.signature(python_callable)
+
+ # Don't allow context argument defaults other than None to avoid
ambiguities.
+ if any(
+ param.name in KNOWN_CONTEXT_KEYS and param.default not in (None,
inspect.Parameter.empty)
+ for param in signature.parameters.values()
+ ):
+ raise ValueError("Context key parameters can't have a default
other than None")
Review Comment:
Would it be helpful if this shows which argument is at fault? Or is it
unnecessary?
--
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]