When I execute a query lambda with python
results = qlambda.execute(parameters=params)
print(type(results))
this shown me
<class 'rockset.swagger_client.models.query_response.QueryResponse'>
How can I convert this data in dict?
I usually use this code
if 'results' in results: #to check ik results key is in the dict
The results of this code is
if 'results' in results:
File "/usr/lib/python3.10/site-packages/rockset/swagger_client/models/query_response.py", line 394, in __getitem__
return getattr(self, item)
TypeError: getattr(): attribute name must be string
When i try to convert to dict wthis this code
resultados = dict(results)
this is the same error
Traceback (most recent call last):
File "/tmp/novale.py", line 16, in <module>
resultados = dict(results)
File "/usr/lib/python3.10/site-packages/rockset/swagger_client/models/query_response.py", line 394, in __getitem__
return getattr(self, item)
TypeError: getattr(): attribute name must be string
When i use this web site https://jsonformatter.curiousconcept.com/ to see the data structure od the response i have some errors like that
* **Info:** Replaced incorrect quotes.
* **Info:** Inserted missing quotes.
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 192]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 197]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 1000]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 1005]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 1840]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 1845]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 2684]*
* **Error:** Expecting comma, colon or }, not string. *[Code 11, Structure 2689]*
maybe the problem is the data and I can not convert the data in standar python dict.