You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support type-safe Parameter annotations without mypy plugin (#496)
* feat: support generic type for TaskInstanceParameter and ListTaskInstanceParameter
* fix: unsupport non typed Task parameter
* fix: support new type hint
* docs: add next type hint
* chore: import from typing_extensions if Python version is less than 3.11
* fix: use StrParameter instead of Parameter
Copy file name to clipboardExpand all lines: docs/setting_task_parameters.rst
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Setting Task Parameters
3
3
============================
4
4
5
-
There are several ways to set task parameters.
5
+
There are several ways to set task parameters.
6
6
7
7
- Set parameter from command line
8
8
- Set parameter at config file
@@ -26,7 +26,7 @@ Set parameter at config file
26
26
[sample.SomeTask]
27
27
param = Hello
28
28
29
-
Above config file (``config.ini``) must be read before ``gokart.run()`` as the following code:
29
+
Above config file (``config.ini``) must be read before ``gokart.run()`` as the following code:
30
30
31
31
.. code:: python
32
32
@@ -68,12 +68,12 @@ Parameter values can be inherited from other task using ``@inherits_config_param
68
68
.. code:: python
69
69
70
70
classMasterConfig(luigi.Config):
71
-
param: str= luigi.Parameter()
72
-
param2: str= luigi.Parameter()
71
+
param: luigi.Parameter= luigi.Parameter()
72
+
param2: luigi.Parameter= luigi.Parameter()
73
73
74
74
@inherits_config_params(MasterConfig)
75
75
classSomeTask(gokart.TaskOnKart):
76
-
param: str= luigi.Parameter()
76
+
param: luigi.Parameter= luigi.Parameter()
77
77
78
78
79
79
This is useful when multiple tasks has the same parameter. In the above example, parameter settings of ``MasterConfig`` will be inherited to all tasks decorated with ``@inherits_config_params(MasterConfig)`` as ``SomeTask``.
@@ -84,12 +84,12 @@ In the above example, ``param2`` will not be available in ``SomeTask``, since ``
0 commit comments