Lee-W commented on code in PR #58615:
URL: https://github.com/apache/airflow/pull/58615#discussion_r2567338329


##########
providers/standard/src/airflow/providers/standard/operators/hitl.py:
##########
@@ -84,6 +84,9 @@ def __init__(
         self.multiple = multiple
 
         self.params: ParamsDict = params if isinstance(params, ParamsDict) 
else ParamsDict(params or {})
+        if hasattr(self.params, "filter_params_by_source"):
+            # Params that exist only in Dag level does not make sense to 
appear in HITLOperator
+            self.params = ParamsDict.filter_params_by_source(self.params, 
source="task")

Review Comment:
   It's for backward compatibility, but `hasattr(ParamsDict, 
"filter_params_by_source")` is more explicit.



##########
task-sdk/src/airflow/sdk/definitions/param.py:
##########
@@ -51,15 +51,27 @@ class Param:
 
     CLASS_IDENTIFIER = "__class"
 
-    def __init__(self, default: Any = NOTSET, description: str | None = None, 
**kwargs):
+    def __init__(
+        self,
+        default: Any = NOTSET,
+        description: str | None = None,
+        source: Literal["Dag", "task", "Dag run"] | None = None,

Review Comment:
   It's missed 🤦‍♂️ Updated. Thanks!



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