Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Is there an option to return execute_sql results as a list of dictionaries? #958

Closed

Description

@yaozhang09

right now the results returned from snapshot.execute_sql() gets returned as a list of arrays. Is there an existing configuration to change the return format of the StreamedResultSet object?

I would like to use keys instead of row indices when pulling values out for further processing. If i ever had to update the running query I would have to make sure my indices are correct. I can easily convert the row to dictionary but want to see if there's a configuration i'm missing.

Activity

  1. asthamohta commented on Jun 12, 2023

    @asthamohta
    Contributor

    hi @yaozhang09, currently we don't. If you like we can add an additional function which you can use on the result returned. But we won't be able to change the existing functionality as it will be breaking change. Let me know 😊

  2. yaozhang09 commented on Jun 12, 2023

    @yaozhang09
    Author

    that would be great if another function that would allow us to return the results in a different format, thanks for letting me know!

  3. asthamohta commented on Jun 21, 2023

    @asthamohta
    Contributor

    Sure give me some time. Thanks

  4. asthamohta commented on Aug 17, 2023

    @asthamohta
    Contributor
  5. yaozhang09 commented on Sep 25, 2023

    @yaozhang09
    Author

    sorry just following up, this LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions