dolphinscheduler-sdk-python
dolphinscheduler-sdk-python copied to clipboard
[impv] Auto check and add output local_params if we define the special grammar in the task definition
For example If we define the shell task, and the command like this
task = Shell(name="example", command="${setValue(a=1)}")
Then we can auto add the output local_params {"prop": "a", "direct": "OUT", "type": "VARCHAR", "value": ""}
The Python, SQL, Procedure also can do this
@zhongjiajie Sir please assign this issue to me and brief me about the issue.
currently, we have to explicitly declare the parameters that need to be set output, such as
task = Shell(name="example", command="${setValue(a=1)}", output_params={
"a": "",
})
and this issue want to remove the param output_params in Shell,
task = Shell(name="example", command="${setValue(a=1)}")
and we set in in pydolphinscheduler
@zhongjiajie Sir, sorry for the delayed response. My internal University exams were going on that's why I was not able to respond, sir I looked into this isssue and I am finding it a bit difficult due to certain reasons:
- The current Shell class has no explicit code for defining or managing output parameters.
- Integration of setValue internally with task classes is kind of very confusing for me. Can you please provide me with some hints on how to approach this problem ,I am feeling very overwhelmed.
hi, @HarshitNagpal29 do not worry about that, handle your exams it more important thing. and
- We have this parameter in our base class, and shell task inherit the base class, which you can see in https://github.com/apache/dolphinscheduler-sdk-python/blob/a7026dab2fb8443e66b72160b5a54977c3d07211/src/pydolphinscheduler/core/task.py#L169
- the
setValueis the keyword for dolphinschdudler,we use it to set output value in dolphinscheduler web ui, which you can see in https://dolphinscheduler.apache.org/en-us/docs/3.2.0/guide/parameter/context. As you can see, In web ui we have to do bothsetValuein the content of task definition, and add output parameter incustomer parameterand set it asout. but I think we can just usesetValuesyntax in python sdk, then detect and set param by python sdk itself