Skip to content
Advertisement

Getting “not all arguments converted during string formatting” exception in AWS Lambda function

I am trying to write an AWS Lambda function in python that retrieves records from a table. I have no trouble running the code locally. However, when I run the code in AWS Lambda function, I get the error “not all arguments converted during string formatting”.

The query is executed by the following code:

class SalesReceipt(declarative_base(), PersistentBase.PersistentBase): tablename = ‘sales_receipts’

JavaScript

The error is encountered during statement result = query.all(). Nothing is executed after that and none of my catch blocks are entered.

I have googled this statement but have not found any clue as to why this is happening inside sqlalchemy functions. I have verified that the query is correct by printing the query out and executing it against the database manually.

I am also a newbie to python so any help will be appreciated.

Advertisement

Answer

Most likely the issue is in the following line –

JavaScript

ex is passed but never included in the string. Try the following instead –

JavaScript

or

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement