GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ReadOptions support for 'Connection.lookup', 'Connection.run_query' · Issue #305 · googleapis/google-cloud-python

ReadOptions support for 'Connection.lookup', 'Connection.run_query' #305

New issue
Copy link
New issue
Copy link
Closed
#449
Closed
ReadOptions support for 'Connection.lookup', 'Connection.run_query'#305
#449
Copy link
Assignees
tseaver
Labels
api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@tseaver
tseaver
opened on Oct 28, 2014
Issue body actions

The protobuf specs for the lookup RPC and the runQuery RPC show an optional 'read_options' field, which denominate the consistency level and optional transaction to be used. Do we need to support this field?

Activity

Next
  1. tseaver
    added
    type: questionRequest for information or clarification. Not an issue.
    api: datastoreIssues related to the Datastore API.
    on Oct 28, 2014
  2. tseaver commented on Oct 28, 2014

    @tseaver
    tseaver
    on Oct 28, 2014
    ContributorAuthor
    More actions

    FWIW, the protobuf spec for the ReadOptions message says:

    // The read consistency to use.
    // Cannot be set when transaction is set.
    // Lookup and ancestor queries default to STRONG, global queries default to
    // EVENTUAL and cannot be set to STRONG.
    

    Connection.lookup() would thus resemble:

    def lookup(self, dataset_id, key_pbs, transaction=None, eventual=False):
        ...
    
    • If transaction was passed, we would copy it onto the ReadOpttions.transaction field.
    • Otherwise, if eventual were True, we would set the enum value onto the ReadOptions.read_consistency field.

    We would need to update Dataset.get_entities to allow passing transaction and eventual through to Connection.lookup.

    Likewise, Connection.run_query would resemble:

    def run_query(self, dataset_id, query_pb, namespace=None,
                  transaction=None, read_consistency=None):
        ...
    
    • If transaction was passed, we would copy it onto the ReadOpttions.transaction field.
    • Otherwise, if read_consistency were not-none (one of "STRONG" or "EVENTUAL"), we would set the corresponding enum value onto the ReadOptions.read_consistency field. We would not try to pre-enforce the semantics described in the protobuf spec.

    We would need to update Query.fetch to allow passing transaction and read_consistency through to Connection.run_query.

  3. silvolu commented on Oct 28, 2014

    @silvolu
    silvolu
    on Oct 28, 2014
    Contributor
    More actions

    Sounds good to me. 2 questions:

    • In Connection.lookup and Connection.run_query, should the default value for transaction be the value of the Connection's object transaction, so that if we are already inside a transaction, it's automatically applied ?
    • In Dataset.get_entities and Query.fetch, should we raise an error if a transaction and eventual=True are passed, or silently ignore it and favor one of the two options?
  4. tseaver commented on Oct 28, 2014

    @tseaver
    tseaver
    on Oct 28, 2014
    ContributorAuthor
    More actions

    IRT the first question, that sounds sensible to me (and most like what a user would expect).

    For the second, we might need to rely on having the Connection methods raise an exception (since the allowed values would depend on whether a transaction was active).

  5. silvolu commented on Oct 28, 2014

    @silvolu
    silvolu
    on Oct 28, 2014
    Contributor
    More actions

    Cool, SGTM.

  6. tseaver
    removed
    type: questionRequest for information or clarification. Not an issue.
    on Dec 17, 2014
  7. tseaver
    self-assigned this
    on Dec 17, 2014
  8. tseaver commented on Dec 17, 2014

    @tseaver
    tseaver
    on Dec 17, 2014
    ContributorAuthor
    More actions

    I think maybe we leave transaction out of the signature of Connection.lookup and Query.fetch: if the connection already has a transaction, then we just use it (and raise an error if eventual is passed). Otherwise, if eventual is passed we set the flag on the request.

    I don't know if we should be trying to pre-enforce that STRONG is incompatible with queries that are not ancestor-based. I'm assuming that the back-end returns an error if the QueryRequest protobuf contains it with a non-ancestor filter.

  9. tseaver
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Dec 19, 2014
  10. tseaver
    closed this as completedin #449on Dec 19, 2014
  11. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  12. atulep
    added 2 commits that reference this issue on Apr 6, 2023

    chore(deps): update dependency google-cloud-storage to v2 (#305)

    186f4f2

    chore(deps): update dependency google-cloud-storage to v2 (#305)

    02a291d
  13. 32 remaining items

  14. parthea
    added 10 commits that reference this issue on Nov 22, 2025

    docs: add paramter mutation_timeout to instance.table docs (#305)

    176ea7e

    chore(main): release 0.35.0 (#305)

    111a493

    feat: Adding support to specify browser while launching browser to au…

    3de0a5c

    chore(main): release 1.20.3 (#305)

    ea01e1f

    chore(python): use ubuntu 22.04 in docs image (#305)

    84d1c8e

    test: use python 3.10 for docs (#305)

    a361d3e

    chore(deps): update all dependencies (#305)

    3a2f26f

    chore: docs, tests, and formatting updates via generator (#305)

    043cb49

    fix: Fix bug with the _GlobalCacheGetBatch. (#305)

    15f3c1d

    Release v1.6.1 (#305)

    8799073
  15. parthea
    added a commit that references this issue on Feb 9, 2026

    chore(deps): update github artifact actions (major) (#305)

    6c389e2
  16. parthea
    added 3 commits that reference this issue on Mar 2, 2026

    chore: fix kokoro and mypy presubmits (#305)

    9a48cea

    dbapi: implement 2 different Connection+Cursor combinations

    638e09f

    tests: bump max retries for 429/503 (#305)

    9b920eb
  17. ohmayr
    added a commit that references this issue on Mar 31, 2026

    chore: fix kokoro and mypy presubmits (#305)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.