Skip to content

Spanner docs are outdated #3740

Closed
Closed

Description

@vkedia

Spanner docs still talk about checking out a session and then doing operations on that such as session.snapshot and session.batch.
We changed the API long time back where such operations can be done directly on the database object and that is the API we want to promote. Please audit all the docs to scrub out all the calls directly made on session object and replace those with calls on Database object. This should be doe before Beta since we expect an uptick in usage once we mark the client as Beta and we want to people to use the preferred API.

Activity

  1. added
    api: spannerIssues related to the Spanner API.
    priority: p0Highest priority. Critical issue. P0 implies highest priority.
    on Aug 7, 2017
  2. vkedia commented on Aug 7, 2017

    @vkedia
    Author
  3. vkedia commented on Aug 7, 2017

    @vkedia
    Author

    Also the snapshot doc should talk about nuances of using Snapshots with multi use and single use and the fact that users need to call begin if they need to have multiple pending operations.

  4. added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    release blockingRequired feature/issue must be fixed prior to next release.
    and removed
    priority: p0Highest priority. Critical issue. P0 implies highest priority.
    on Aug 7, 2017
  5. tseaver commented on Aug 9, 2017

    @tseaver
    Contributor

    I presume we will drop discussion of sessions from the narrative / usage docs, but leave the API docs pages in place (since users might still come across them, e.g. in tracebacks).

  6. vkedia commented on Aug 9, 2017

    @vkedia
    Author

    Yeah I agree leaving the API docs pages in place is OK. We can probably emphasise on those API docs that most users need not interact with these objects directly.

  7. vkedia commented on Nov 17, 2017

    @vkedia
    Author

    cc @lukesneeringer @danoscarmike
    I don;t think this has been completely resolved. For eg the transactions doc still talks about using a session and does not mention database.run_in_transaction method:
    https://googlecloudplatform.github.io/google-cloud-python/stable/spanner/transaction-usage.html

    Ditto for snapshots page:
    https://googlecloudplatform.github.io/google-cloud-python/stable/spanner/snapshot-usage.html

    Can we please reopen this bug? I would also like this to be fixed before marking the client library as GA.

  8. chemelnucfin commented on Nov 17, 2017

    @chemelnucfin
    Contributor
  9. vkedia commented on Nov 17, 2017

    @vkedia
    Author

    @chemelnucfin Can you reopen this? I do not have permissions.

  10. chemelnucfin commented on Dec 1, 2017

    @chemelnucfin
    Contributor

    @vkedia so just to make sure, all these methods currently on the session object should be directly done on the database object? Is the session object still needed then?
    Any other methods which should be directly on the database?

    def snapshot(self, **kw):
    def read(self, table, columns, keyset, index='', limit=0):
    def execute_sql(self, sql, params=None, param_types=None, query_mode=None):
    def batch(self):
    def transaction(self):
    def run_in_transaction(self, func, *args, **kw):
    
  11. vkedia commented on Dec 1, 2017

    @vkedia
    Author

    Users should never have to use session object for anything. If possible we should make it non public.
    Also we removed the read and execute_sql methods from database. So users need to create a snapshot to do that.

  12. lukesneeringer commented on Dec 18, 2017

    @lukesneeringer
    Contributor

    @chemelnucfin Is there a PR corresponding to this issue? (Other than the last couple of tests, I think it is the last GA blocking item.)

  13. chemelnucfin commented on Dec 20, 2017

    @chemelnucfin
    Contributor

    Closed via #4610, #4611, #4409, #4630

  14. added a commit that references this issue on Nov 22, 2025
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 Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.release blockingRequired feature/issue must be fixed prior to next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions