Browse Source

[Bug][Python] Python class description error (#12360)

3.2.0-release
chenrj 2 years ago committed by GitHub
parent
commit
cd5fb12e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/tasks/python.py

10
dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/tasks/python.py

@ -33,22 +33,22 @@ log = logging.getLogger(__file__)
class Python(Task): class Python(Task):
"""Task Python object, declare behavior for Python task to dolphinscheduler. """Task Python object, declare behavior for Python task to dolphinscheduler.
Python task support two types of parameters for :param:``code``, and here is an example: Python task support two types of parameters for :param:``definition``, and here is an example:
Using str type of :param:``code`` Using str type of :param:``definition``
.. code-block:: python .. code-block:: python
python_task = Python(name="str_type", code="print('Hello Python task.')") python_task = Python(name="str_type", definition="print('Hello Python task.')")
Or using Python callable type of :param:``code`` Or using Python callable type of :param:``definition``
.. code-block:: python .. code-block:: python
def foo(): def foo():
print("Hello Python task.") print("Hello Python task.")
python_task = Python(name="str_type", code=foo) python_task = Python(name="str_type", definition=foo)
:param name: The name for Python task. It define the task name. :param name: The name for Python task. It define the task name.
:param definition: String format of Python script you want to execute or Python callable you :param definition: String format of Python script you want to execute or Python callable you

Loading…
Cancel
Save