apache / dolphinscheduler-sdk-python

Apache DolphinScheduler Python API, aka PyDolphinscheduler.
https://dolphinscheduler.apache.org/python/main
Apache License 2.0
52 stars 19 forks source link

how to check the status of the task created via below code #146

Open Rockhillsystems opened 6 months ago

Rockhillsystems commented 6 months ago

ive tried to create a workfow n task using below py code, how to get the status of this task from another python script dynamically. kindly help.

[start workflow_declare]

r""" A tutorial example set local parameter in pydolphinscheduler.

from pydolphinscheduler.core.parameter import ParameterType from pydolphinscheduler.core.workflow import Workflow from pydolphinscheduler.tasks.shell import Shell

import argparse

parser = argparse.ArgumentParser() parser.add_argument("-p", "--pdffilepath", type=str) parser.add_argument("-o", "--outputfilepath", type=str)

args = parser.parse_args() pdf = args.pdffilepath output = args.outputfilepath

with Workflow(name="pdf2svgnew", release_state="online") as workflow:

[start parameter example]

# define a parameter "pdffilepath", and use it in Shell task
pdf2svg = Shell(
    name="pdf2svgnew",
    command="pdf2svg "  + pdf + " " +   output + "    all "

# [start submit_or_run]

workflow.run()

    # [end submit_or_run]
# [end parameter define]

[end workflow_declare]

zhongjiajie commented 6 months ago

hi @Rockhillsystems, Actually pydolphinscheduler is only for definition not for instance, so we can not get the status from pydolphinscheduler. you can still check the status of task instance by web ui