-
-
Notifications
You must be signed in to change notification settings - Fork 431
How do you return a JSON result from a python handler? #28
Comments
The return value of the Python function should work: https://github.com/lambci/docker-lambda/blob/master/examples/docker-run-python2.7/lambda_function.py |
I've tried using the python function return as implied from the example, but that does not work as expected.
This will work when you call docker directly.
$ node temp.js I'm unclear how to get lambdaCallBackResult to contain the value returned from the python lambda_handler. |
Hmmm, not sure why that's happening off the top of my head – quickly glancing at the code responsible seems to indicate it should work (it reads and parses from stdout – and I'm pretty sure that result is going to stdout) Not in front of my comp at the moment, but should be able to look into this more later. Here's what I'd be looking at: https://github.com/lambci/docker-lambda/blob/master/python2.7/run/runtime-mock.py#L142 |
(Unless it's just simply a case of needing to |
I see the same issue trying to retrieve the "It works!" string back from the https://github.com/lambci/docker-lambda/blob/master/examples/docker-run-python2.7/lambda_function.py example. These few lines of code replicate the same issue.
$ node temp.js |
And for completeness, I confirmed that the result and the result only is going to standard out when called with exec.
$ node temp.js |
@SingaporeClouds can you try with the latest version? I believe this might've been fixed in 92f59a6 |
Closing due to lack of activity |
In a node handler, you can return results with the passed in context.
What is the equivalent to do this in Python so that I can evaluate the results coming back from a Python lambda call using dockerLambda? I can not call context.succeed() on the context passed to a python handler.
The text was updated successfully, but these errors were encountered: