Python lambda - #109
Conversation
|
@theobribeiro -- you bring up a good point. The current implementation is flawed. However, if we use |
|
@cbaron - Agreed it doesn't solve the second part of my PR. But even if you don't have any other outputs from sls invoke, using results instead of allResults will truncate the output to just the last chunk of data. allResults is used for all the other invokes (Go and Ruby) and using it solves that specific issue of truncating the result and not being able to parse the json due to a malformed string. |
|
@cbaron Any updates on this PR? I just wasted 2 hours trying to understand why my query was returning an error just to find out it was related to this same issue. The query was big so the result was truncated, resulting in a malformed JSON. |
|
I haven't thought about this issue since you brought it up. Thinking we can try using AWS SAM local, or add some logic where we concat the last |
Whenever the result from the sls invoke was large enough, JSON would only parse the last chunk.
Variable "results" was being used instead of "allResults".
You should consider some other way of getting results from sls invoke since if you have the env variable SLS_DEBUG=* the output from sls will include other information. Same thing if you're debugging your Python function with prints, etc...
I'll put in an issue tomorrow for this bug just so you have it on your radar.