-
Notifications
You must be signed in to change notification settings - Fork 101
feat: return list of dictionaries for execute streaming sql #1003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
07c69ed
6a864c6
bba5e0c
4a43512
21aea8b
93187e0
6a4c9b2
92a3696
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,6 +190,27 @@ def one_or_none(self): | |
except StopIteration: | ||
return answer | ||
|
||
def to_dict_list(self): | ||
"""Return the result of a query as a list of dictionaries. | ||
In each dictionary the key is the column name and the value is the | ||
value of the that column in a given row. | ||
|
||
:rtype: | ||
:class:`list of dict` | ||
:returns: result rows as a list of dictionaries | ||
""" | ||
rows = [] | ||
for row in self: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if rows are not fully processed when this method is called ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There will be a delay in returning the result in those cases but always the full result will be returned |
||
rows.append( | ||
{ | ||
column: value | ||
for column, value in zip( | ||
[column.name for column in self._metadata.row_type.fields], row | ||
) | ||
} | ||
) | ||
return rows | ||
|
||
|
||
class Unmergeable(ValueError): | ||
"""Unable to merge two values. | ||
|
Uh oh!
There was an error while loading. Please reload this page.