2 Answers
1
Accepted Answer
Have you tried doing bite = io.BytesIO(csv_content)
again before the second function call?
0
If your first function uses bite.read()
to get the content of the buffer, the internal buffer cursor will be advanced to the end of the buffer and a subsequent read()
call will return an empty buffer. You can reset the cursor to the beginning of the buffer using bite.seek(0)
. Alternatively, if you can control how the functions you invoke are reading data from the buffer, you could usebite.getvalue()
.
Thanks for your proposed solution, I used the above answer and it works well now.
Relevant questions
change lambda to no longer use zip deployment package
asked 2 months agoHow can I use AWS Glue to split a file by number of lines?
Accepted Answerasked 21 days agoAWS Lambda Python Code
Accepted Answerasked a month agoHow to read DynamoDB table using aws lambda function in python?
asked 4 months agoUsing python-magic in a lambda
asked 20 days agoscript to update python runtime from 3.6 to 3.9 in lambda functions
Accepted Answerasked 3 months agoHow to provide unique filename to each file in each event in aws lambda python?
asked 4 months agoUsing AWS Lambda to run Python script, how can I save data?
Accepted Answerasked 3 years agomost cost effective way to use a bash script to update a csv file
asked 2 months agoHow do I use JSON Lambda output in Step Functions
Accepted Answer
Thanks!! It works well, Why we put it again with the second function?