You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am confusing how to use the output in the function
e.g. i have the 1st function like that:
def handle(req):
"""handle a request to the function
Args:
req (str): request body
"""
print("This is the 1st Python API")
return 1
and the 2nd function like this:
def handle(req):
"""handle a request to the function
Args:
req (str): request body
"""
print("This is the Second Python API")
print("Req is", req)
a = int(req)
b = a+1
print("b is ",b)
return b
Actually, i assume use the 1st function output in the 2nd function, if 1st ret 1, the 2nd will accept the output and make a is 1, then b=2 and return 2.
But when i invoke the flow function, it will throw the exception:
Internal Server Error
[ Failed ] request failed to be processed. error: failed to execute request. Node(0_1_sync), Operation (pytest2), error: execution failed, Function(pytest2), error: function execution failed, invalid return status 500 while connecting http://gateway.openfaas:8080/function/pytest2
seems the 2nd function input req is None make the error.
So what is the right way for this situation, for result pass? thanks for your help
may be the usage is wrong, i assume the intermediate date could store the output like context, so how to share the context between these functions?
or if i can set the context= { "result": "1st function output" }, then could use this context in the 2nd function, is it possible support?
The text was updated successfully, but these errors were encountered:
i am confusing how to use the output in the function
e.g. i have the 1st function like that:
and the 2nd function like this:
Actually, i assume use the 1st function output in the 2nd function, if 1st ret 1, the 2nd will accept the output and make a is 1, then b=2 and return 2.
The flow code here:
But when i invoke the flow function, it will throw the exception:
seems the 2nd function input req is None make the error.
So what is the right way for this situation, for result pass? thanks for your help
may be the usage is wrong, i assume the intermediate date could store the output like context, so how to share the context between these functions?
or if i can set the context= { "result": "1st function output" }, then could use this context in the 2nd function, is it possible support?
The text was updated successfully, but these errors were encountered: