jason810496 commented on code in PR #58615:
URL: https://github.com/apache/airflow/pull/58615#discussion_r2567302130


##########
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:
   Not sure if `"Dag run"` is intend to be here as I only saw `"Dag"` and 
`"task"` above.
   
   ```suggestion
           source: Literal["Dag", "task"] | None = None,
   ```



##########
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 _seems_ we don't need to check the attribute as we had already cast the 
`self.params` as `ParamsDict`, then we could directly call the 
`filter_params_by_source` method?
   
   ```suggestion
           self.params = ParamsDict.filter_params_by_source(self.params, 
source="task")
   ```



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