Browse Source

[3.0.2-prepare][cherry-pick] Fix python class description error (#12790)

Co-authored-by: chenrj <102030622+xdu-chenrj@users.noreply.github.com>
3.0.2-release
Eric Gao 2 years ago committed by GitHub
parent
commit
63f34cc361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DateUtils.java
  2. 10
      dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/tasks/python.py

4
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DateUtils.java

@ -329,8 +329,8 @@ public final class DateUtils {
/**
* format time to duration
*
* @param d1 d1
* @param d2 d2
* @param start start
* @param end end
* @return format time
*/
public static String format2Duration(Date start, Date end) {

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

@ -33,22 +33,22 @@ log = logging.getLogger(__file__)
class Python(Task):
"""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
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
def foo():
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 definition: String format of Python script you want to execute or Python callable you

Loading…
Cancel
Save