This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
feat: return list of dictionaries for execute streaming sql #1003
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
07c69ed
changes
asthamohta 6a864c6
adding tests
asthamohta bba5e0c
Merge branch 'main' into issue-958
asthamohta 4a43512
comment changes
asthamohta 21aea8b
Merge branch 'issue-958' of github.com:asthamohta/python-spanner into…
asthamohta 93187e0
Merge branch 'main' into issue-958
asthamohta 6a4c9b2
Merge branch 'main' into issue-958
asthamohta 92a3696
Merge branch 'main' into issue-958
asthamohta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
|
Contributor
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 ?
Contributor
Author
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. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.