dolphinscheduler-sdk-python icon indicating copy to clipboard operation
dolphinscheduler-sdk-python copied to clipboard

Http yaml error

Open zhyyyq opened this issue 5 months ago • 4 comments

yaml file demo for http

workflow: name: "Http"

Define the tasks within the workflow

tasks:

  • name: task task_type: Http url: https://httpbin.org/get http_method: GET http_params:
    • prop: a httpParametersType: PARAMETER value: "1"
    • prop: b httpParametersType: PARAMETER value: "2"
    • prop: Content-Type httpParametersType: header value: test http_check_condition: STATUS_CODE_CUSTOM condition: "404" type: Http task_params: {}

raise PyDSParamException( "Parameter params must be a dict, but get %s", type(params) ) pydolphinscheduler.exceptions.PyDSParamException: ('Parameter params must be a dict, but get %s', <class 'ruamel.yaml.comments.CommentedSeq'>)

zhyyyq avatar Jul 23 '25 09:07 zhyyyq

https://github.com/zhyyyq/dolphin-scheduler-s1mple

hello i am working on a ui for low code editing the yaml for pydolphinscheduler. So when my frontend loading the yaml file which is from the demo http

Define the workflow

workflow: name: "Http"

Define the tasks within the workflow

tasks:

  • name: task task_type: Http url: "https://httpbin.org/get" http_method: "GET" http_params:
    • { "prop": "a", "httpParametersType": "PARAMETER", "value": "1" }
    • { "prop": "b", "httpParametersType": "PARAMETER", "value": "2" }
    • { "prop": "Content-Type", "httpParametersType": "header", "value": "test", } http_check_condition: "STATUS_CODE_CUSTOM" condition: "404"

and reparse it into standard yaml format.

http_params: - prop: a httpParametersType: PARAMETER value: "1" - prop: b httpParametersType: PARAMETER value: "2" - prop: Content-Type httpParametersType: header value: test

pydolphinscheduler will raise a exception when calling the cli

zhyyyq avatar Jul 23 '25 09:07 zhyyyq

@zhyyyq can you try the same format as https://github.com/apache/dolphinscheduler-sdk-python/blob/main/examples/yaml_define/Http.yaml ?

zhongjiajie avatar Jul 23 '25 11:07 zhongjiajie

zhongjiajie This seems to be broken by 4.1.0: Refactor Http class to utilize ParameterHelper for http_params conver… #130 With this refactoring we cannot define the parametertype anymore because it is a key:value dict and not a list anymore. I had to modify the http.py back to the 4.0.4 for my projects to work. Unfortunately a http parameter has to have a type (parameter, header or body).

basmul-pivoton avatar Oct 09 '25 20:10 basmul-pivoton

Seems dolphinscheduler have more type which key-value can not include

zhongjiajie avatar Nov 08 '25 02:11 zhongjiajie