Skip to content

Support array result include sequence action #129

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

Conversation

ningyougang
Copy link
Contributor

@ningyougang ningyougang commented Jul 25, 2022

Depend on below prs:

@ningyougang
Copy link
Contributor Author

Python supports sequence action by default with support array result, test steps as below

  • Write split.py and sort.py
[root@nccddev130026 ~]# cat ~/split.py 
def main(args):
    payload = args.get("payload", "aaaa\nbbbb\nccccc")
    separator = args.get("separator", "\n")
    result = payload.split(separator)
    return result

[root@nccddev130026 ~]# cat ~/sort.py 
def main(args):
    if args is None:
        args = ["data1", "data2", "data3"]
    result = args[::-1]
    return result
  • Create action and invoke it (python:3.7/3.9 both tested, worked well both)
wsk -i action create /whisk.system/utils/split-python --kind python:3.7 ~/split.py
wsk -i action create /whisk.system/utils/sort-python --kind python:3.7 ~/sort.py
wsk -i action create mySequence-python --sequence /whisk.system/utils/split-python,/whisk.system/utils/sort-python
wsk -i action invoke --result mySequence-python --param payload "dddd\nbbbb\ncccc\nfffffff\nggggggggg" -r -v

@ningyougang ningyougang force-pushed the support-array-result-include-sequence-action branch 2 times, most recently from cad757d to 56f0dab Compare August 8, 2022 02:07
@ningyougang ningyougang force-pushed the support-array-result-include-sequence-action branch from e6acc9a to 3c45bee Compare August 9, 2022 07:40
Copy link
Member

@dgrove-oss dgrove-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgrove-oss dgrove-oss merged commit 18270cc into apache:master Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants