FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support array result include sequence action by ningyougang · Pull Request #129 · apache/openwhisk-runtime-python · GitHub

Support array result include sequence action - #129

Merged
dgrove-oss merged 7 commits into
apache:masterfrom
ningyougang:support-array-result-include-sequence-action
Aug 15, 2022
Merged

dgrove-oss merged 7 commits into
apache:masterfrom
ningyougang:support-array-result-include-sequence-action

Conversation

ningyougang commented Jul 25, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

Depend on below prs:

Copy link
Copy Markdown
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 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 force-pushed the support-array-result-include-sequence-action branch from e6acc9a to 3c45bee Compare August 9, 2022 07:40
Comment thread core/python310Action/Dockerfile Outdated

dgrove-oss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

dgrove-oss merged commit 18270cc into apache:master Aug 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL