ashb commented on code in PR #46176:
URL: https://github.com/apache/airflow/pull/46176#discussion_r1932021183


##########
airflow/example_dags/example_params_trigger_ui.py:
##########
@@ -27,7 +27,7 @@
 
 from airflow.decorators import task
 from airflow.models.dag import DAG
-from airflow.models.param import Param, ParamsDict
+from airflow.sdk.definitions.param import Param, ParamsDict

Review Comment:
   Same thing here, lets make this work in dags
   
   ```suggestion
   from airflow.sdk import Param, ParamsDict
   ```



##########
airflow/models/__init__.py:
##########
@@ -99,7 +99,8 @@ def __getattr__(name):
     "Log": "airflow.models.log",
     "MappedOperator": "airflow.models.mappedoperator",
     "Operator": "airflow.models.operator",
-    "Param": "airflow.models.param",
+    "Param": "airflow.sdk.definitions.param",
+    "ParamsDict": "airflow.sdk.definitions.param",

Review Comment:
   Lets not add anything new to this list
   ```suggestion
   ```



##########
tests/models/test_param.py:
##########


Review Comment:
   I suspect all or almost all of this test file should be moved over to the 
task SDK too.



##########
airflow/example_dags/example_params_trigger_ui.py:
##########
@@ -27,7 +27,7 @@
 
 from airflow.decorators import task
 from airflow.models.dag import DAG
-from airflow.models.param import Param, ParamsDict
+from airflow.sdk.definitions.param import Param, ParamsDict

Review Comment:
   Ah you already have it working, lets use it then



##########
tests/serialization/test_dag_serialization.py:
##########
@@ -2204,7 +2204,7 @@ def test_params_serialize_default_2_2_0(self):
                 "fileloc": "/path/to/file.py",
                 "tasks": [],
                 "timezone": "UTC",
-                "params": [["str", {"__class": "airflow.models.param.Param", 
"default": "str"}]],
+                "params": [["str", {"__class": 
"airflow.sdk.definitions.param.Param", "default": "str"}]],

Review Comment:
   Note: even when we change the user facing import to `airflow.sdk` these 
should I expect stay the same.



##########
docs/apache-airflow/core-concepts/params.rst:
##########
@@ -40,7 +40,7 @@ Use a dictionary that maps Param names to either a 
:class:`~airflow.models.param
 
     from airflow import DAG
     from airflow.decorators import task
-    from airflow.models.param import Param
+    from airflow.sdk.definitions.param import Param

Review Comment:
   This is the important one.
   
   ```suggestion
       from airflow.sdk import Param
   ```



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