From e7f3ff9f9dc5b5a2eaea0e9e0b7571314bd873f7 Mon Sep 17 00:00:00 2001 From: Kurt Schwehr Date: Mon, 27 Sep 2021 13:26:26 -0700 Subject: [PATCH] chore: fix docstring typos (found via codespell) (#724) ``` codespell --version 2.1.0 ``` --- google/cloud/ndb/_eventloop.py | 4 ++-- google/cloud/ndb/context.py | 4 ++-- google/cloud/ndb/global_cache.py | 2 +- google/cloud/ndb/model.py | 2 +- tests/system/test_crud.py | 16 ++++++++-------- tests/unit/orchestrate.py | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/google/cloud/ndb/_eventloop.py b/google/cloud/ndb/_eventloop.py index 6169d7bf..4a4a6827 100644 --- a/google/cloud/ndb/_eventloop.py +++ b/google/cloud/ndb/_eventloop.py @@ -246,7 +246,7 @@ def run_idle(self): """Run one of the idle callbacks. Returns: - bool: Indicates if an idle calback was called. + bool: Indicates if an idle callback was called. """ if not self.idlers or self.inactive >= len(self.idlers): return False @@ -270,7 +270,7 @@ def _run_current(self): """Run one current item. Returns: - bool: Indicates if an idle calback was called. + bool: Indicates if an idle callback was called. """ if not self.current: return False diff --git a/google/cloud/ndb/context.py b/google/cloud/ndb/context.py index f8dff2d0..8eb1928b 100644 --- a/google/cloud/ndb/context.py +++ b/google/cloud/ndb/context.py @@ -40,7 +40,7 @@ class _ContextIds: sufficient to uniquely identify the context in which a particular piece of code is being run. Each context, as it is created, is assigned the next id in this sequence. The context id is used by `utils.logging_debug` to grant insight into where a debug - logging statement is coming from in a cloud evironment. + logging statement is coming from in a cloud environment. """ def __init__(self): @@ -138,7 +138,7 @@ def get_toplevel_context(raise_context_error=True): The toplevel context is the context created by the call to :meth:`google.cloud.ndb.client.Client.context`. At times, this context will - be superceded by subcontexts, which are used, for example, during + be superseded by subcontexts, which are used, for example, during transactions. This function will always return the top level context regardless of whether one of these subcontexts is the current one. diff --git a/google/cloud/ndb/global_cache.py b/google/cloud/ndb/global_cache.py index 906a1294..4e3c6b7c 100644 --- a/google/cloud/ndb/global_cache.py +++ b/google/cloud/ndb/global_cache.py @@ -125,7 +125,7 @@ def set_if_not_exists(self, items, expires=None): Returns: - Dict[bytes, bool]: A `dict` mapping to boolean value wich will be + Dict[bytes, bool]: A `dict` mapping to boolean value that will be :data:`True` if that key was set with a new value, and :data:`False` otherwise. """ diff --git a/google/cloud/ndb/model.py b/google/cloud/ndb/model.py index a51a280f..78c52f16 100644 --- a/google/cloud/ndb/model.py +++ b/google/cloud/ndb/model.py @@ -6156,7 +6156,7 @@ def _code_name_from_stored_name(cls, name): # class SomeKind(ndb.Model): # foo = ndb.IntegerProperty(name="bar") # - # If we are passed "bar", we know to translate that to "foo", becasue + # If we are passed "bar", we know to translate that to "foo", because # the datastore property, "bar", is the NDB property, "foo". But if we # are passed "foo", here, then that must be the datastore property, # "foo", which isn't even mapped to anything in the NDB model. diff --git a/tests/system/test_crud.py b/tests/system/test_crud.py index 4b2d1249..a2208ff9 100644 --- a/tests/system/test_crud.py +++ b/tests/system/test_crud.py @@ -1484,9 +1484,9 @@ class SomeKind(ndb.Model): key = entity.put() dispose_of(key._key) - retreived = key.get() - assert retreived.user.email() == "somebody@example.com" - assert retreived.user.auth_domain() == "gmail.com" + retrieved = key.get() + assert retrieved.user.email() == "somebody@example.com" + assert retrieved.user.auth_domain() == "gmail.com" @pytest.mark.usefixtures("client_context") @@ -1508,9 +1508,9 @@ def user_id(self): key = entity.put() dispose_of(key._key) - retreived = key.get() - assert retreived.user.email() == "somebody@example.com" - assert retreived.user.auth_domain() == "gmail.com" + retrieved = key.get() + assert retrieved.user.email() == "somebody@example.com" + assert retrieved.user.auth_domain() == "gmail.com" @pytest.mark.usefixtures("client_context") @@ -1527,8 +1527,8 @@ class SomeKind(ndb.Model): key = entity.put() dispose_of(key._key) - retreived = key.get() - assert retreived.foo == ["", ""] + retrieved = key.get() + assert retrieved.foo == ["", ""] @pytest.mark.skipif(not USE_REDIS_CACHE, reason="Redis is not configured") diff --git a/tests/unit/orchestrate.py b/tests/unit/orchestrate.py index 5ac0c01a..5380fc0a 100644 --- a/tests/unit/orchestrate.py +++ b/tests/unit/orchestrate.py @@ -219,7 +219,7 @@ def hither_and_yon(destination): class _Conductor: """Coordinate communication between main thread and a test thread. - Two way communicaton is maintained between the main thread and a test thread using + Two way communication is maintained between the main thread and a test thread using two synchronized queues (`queue.Queue`) each with a size of one. """