Skip to content
Advertisement

Pymysql DictCursor returning list rather than dictionary

I am trying to figure out why this query is returning a list of lists rather than a list of dictionaries. I suspect it has something to do with either the join or the ‘as’ portion of the query. Any insight into this would be appreciated.

Code Below:

Which returns in order of execution:

First: A list of dictionaries matching the query with column_name:value, which is what I expect.

Second: A list like this ((‘63741’, ‘7598.7924528302’, merchant_id, ‘store_name’),)

Advertisement

Answer

Try:

I changed the cursor type to be inside the connect method

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