Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[impv] Auto check and add output local_params if we define the special grammar in the task definition #61

Open
jieguangzhou opened this issue Dec 21, 2022 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@jieguangzhou
Copy link
Member

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

@HarshitNagpal29
Copy link
Contributor

@zhongjiajie Sir please assign this issue to me and brief me about the issue.

@zhongjiajie
Copy link
Member

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

@HarshitNagpal29
Copy link
Contributor

HarshitNagpal29 commented Jan 25, 2024

@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:

  1. The current Shell class has no explicit code for defining or managing output parameters.
  2. 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.

@zhongjiajie
Copy link
Member

hi, @HarshitNagpal29 do not worry about that, handle your exams it more important thing. and

  1. We have this parameter in our base class, and shell task inherit the base class, which you can see in
    output_params: Optional[Dict] = None,
  2. the setValue is 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 both setValue in the content of task definition, and add output parameter in customer parameter and set it as out. but I think we can just use setValue syntax in python sdk, then detect and set param by python sdk itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants