Skip to content
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

Allow specifying read consistency #4343

Merged

Conversation

chemelnucfin
Copy link
Contributor

@chemelnucfin chemelnucfin commented Nov 3, 2017

Closes #4340

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 3, 2017
@chemelnucfin chemelnucfin changed the title Closes #4340 - Specify Read Consistency Datastore: Closes #4340 - Specify Read Consistency Nov 3, 2017
@chemelnucfin chemelnucfin force-pushed the issue4340-readconsistency branch 2 times, most recently from a79426d to b1258fe Compare November 4, 2017 18:01
Copy link
Contributor

@lukesneeringer lukesneeringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sane to me. Please get either @tseaver or @dhermes to also say yes before merging.

@chemelnucfin
Copy link
Contributor Author

chemelnucfin commented Nov 6, 2017 via email

@tseaver
Copy link
Contributor

tseaver commented Nov 6, 2017

@chemelnucfin Please put the "Closes #4340" in the description, not the title. E.g., for a single-commit PR:

$ git commit datastore/ -m "Specify read consistency.

Closes #4340."

@tseaver tseaver changed the title Datastore: Closes #4340 - Specify Read Consistency Datastore: Specify Read Consistency Nov 6, 2017
@tseaver tseaver added api: datastore Issues related to the Datastore API. api: videointelligence Issues related to the Video Intelligence API API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed api: videointelligence Issues related to the Video Intelligence API API. labels Nov 6, 2017
@tseaver
Copy link
Contributor

tseaver commented Nov 6, 2017

Also, please add labels when you create the PR.

@tseaver tseaver changed the title Datastore: Specify Read Consistency Allow specifying read consistency Nov 6, 2017
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests for get_read_options need to move from test_client.py to test_helpers.py.

_determine_default_project as _base_default_project)
from google.cloud._helpers import (_determine_default_project as
_default_project)

This comment was marked as spam.

from google.cloud.datastore.batch import Batch
from google.cloud.datastore.entity import Entity
from google.cloud.datastore.key import Key
from google.cloud.datastore.query import Query
from google.cloud.datastore.transaction import Transaction

This comment was marked as spam.

@@ -74,7 +75,7 @@ def _determine_default_project(project=None):
project = _get_gcd_project()

if project is None:
project = _base_default_project(project=project)
project = _default_project(project=project)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -302,15 +304,27 @@ def get(self, key, missing=None, deferred=None, transaction=None):
:param transaction: (Optional) Transaction to use for read consistency.
If not passed, uses current transaction, if set.

:type eventual: bool
:param eventual: (Optional) Defaults to strongly consistent (False).
Setting True will use eventual consistency,

This comment was marked as spam.

This comment was marked as spam.

@@ -350,7 +371,8 @@ def get_multi(self, keys, missing=None, deferred=None, transaction=None):
entity_pbs = _extended_lookup(
datastore_api=self._datastore_api,
project=self.project,
key_pbs=[k.to_protobuf() for k in keys],
key_pbs=[key.to_protobuf() for key in keys],

This comment was marked as spam.

from google.cloud.datastore.entity import Entity
from google.cloud.datastore.key import Key
from google.cloud.proto.datastore.v1 import entity_pb2 as _entity_pb2
from google.cloud.proto.datastore.v1 import datastore_pb2 as _datastore_pb2

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Nov 6, 2017
@tseaver
Copy link
Contributor

tseaver commented Nov 6, 2017

@chemelnucfin Rather than merging master into your branch (which is what confused the @goolebot) we prefer to rebase the branch against master, which keeps the PR focused on just the relevant changes.

@chemelnucfin chemelnucfin force-pushed the issue4340-readconsistency branch from 0d45147 to 9605172 Compare November 6, 2017 20:08
@chemelnucfin
Copy link
Contributor Author

Sorry about that. I think I rebased on the wrong branch. I think that's better now.

@chemelnucfin
Copy link
Contributor Author

@dhermes @tseaver Is this ok?

@chemelnucfin chemelnucfin added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Nov 8, 2017
@chemelnucfin chemelnucfin force-pushed the issue4340-readconsistency branch from 664e5cc to d09d907 Compare November 9, 2017 05:40
@chemelnucfin chemelnucfin merged commit 4941cbf into googleapis:master Nov 9, 2017
from google.cloud._helpers import (
_determine_default_project as _base_default_project)
from google.cloud._helpers import (_determine_default_project as
_base_default_project)

This comment was marked as spam.

from google.cloud.datastore.entity import Entity
from google.cloud.datastore.key import Key

from google.protobuf import struct_pb2
from google.type import latlng_pb2

This comment was marked as spam.

chemelnucfin added a commit to chemelnucfin/google-cloud-python that referenced this pull request Nov 9, 2017
chemelnucfin added a commit to chemelnucfin/google-cloud-python that referenced this pull request Nov 9, 2017
chemelnucfin added a commit that referenced this pull request Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants