as_dict() on a row fails when connected to MySQL on Amazon RDS

27 views
Skip to first unread message

Sean Ballow

unread,
Jul 1, 2015, 10:01:19 AM7/1/15
to web...@googlegroups.com
We are connecting successfully to MySQL on RDS

And when attempting to insert a new record it appears to properly insert into the database and we receive an ID back, for instance

result = db.foo.insert(myfield='blah')

print result
>> 1

The problem occurs when performing the following after successfully inserting a record and committing it

result.as_dict()
>> TypeError: 'NoneType' object is not callable

result is a ROW instance and the following continues to work

print result.id
>> 1

however as_dict() fails only when connected to MySQL on RDS and not when using the MySQL local instance

Oddly enough when I use the same application connected to a locally running instance of MySQL we do not receive the exception and everything works as desired.

Any ideas what may be causing the disparity between a connection to a local MySQL instance and a MySQL RDS instance? I have compared system variables between both databases and was unable to identify a problem

Thanks for your help

Niphlod

unread,
Jul 2, 2015, 3:10:41 PM7/2/15
to web...@googlegroups.com
I'm pretty sure that 

newly_inserted_id = db.table.insert(...)

should return an integer, not a row.

Robert Porter

unread,
Jul 3, 2015, 12:00:22 PM7/3/15
to web...@googlegroups.com
Could you show your DB code for reference?  And you should jump in appadmin to check just what has been uploaded to the DB to be sure.
Reply all
Reply to author
Forward
0 new messages