From 5642d4d9a1a2678c93aabcc5078ecf3ee7f7760c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 8 Jul 2024 19:29:38 +0000 Subject: [PATCH 1/4] chore(python): use python 3.10 for docs build Source-Link: https://github.com/googleapis/synthtool/commit/9ae07858520bf035a3d5be569b5a65d960ee4392 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:52210e0e0559f5ea8c52be148b33504022e1faef4e95fbe4b32d68022af2fa7e --- .github/.OwlBot.lock.yaml | 4 +-- .kokoro/docker/docs/Dockerfile | 21 +++++++------ .kokoro/docker/docs/requirements.txt | 40 +++++++++++++----------- .kokoro/requirements.txt | 46 ++++++++++++++-------------- 4 files changed, 59 insertions(+), 52 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 91d742b5..f30cb377 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:d3de8a02819f65001effcbd3ea76ce97e9bcff035c7a89457f40f892c87c5b32 -# created: 2024-07-03T17:43:00.77142528Z + digest: sha256:52210e0e0559f5ea8c52be148b33504022e1faef4e95fbe4b32d68022af2fa7e +# created: 2024-07-08T19:25:35.862283192Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 834361ad..73bbc9e7 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:22.04 +from ubuntu:24.04 ENV DEBIAN_FRONTEND noninteractive @@ -44,7 +44,6 @@ RUN apt-get update \ libsqlite3-dev \ memcached \ portaudio19-dev \ - python3-distutils \ redis-server \ software-properties-common \ ssh \ @@ -64,18 +63,22 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb -###################### Install python 3.9.13 -# Download python 3.9.13 -RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz +###################### Install python 3.10.14 for docs/docfx session + +# Download python 3.10.14 +RUN wget https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tgz # Extract files -RUN tar -xvf Python-3.9.13.tgz +RUN tar -xvf Python-3.10.14.tgz -# Install python 3.9.13 -RUN ./Python-3.9.13/configure --enable-optimizations +# Install python 3.10.14 +RUN ./Python-3.10.14/configure --enable-optimizations RUN make altinstall +RUN python3.10 -m venv /venv +ENV PATH /venv/bin:$PATH + ###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ && python3 /tmp/get-pip.py \ @@ -88,4 +91,4 @@ RUN python3 -m pip COPY requirements.txt /requirements.txt RUN python3 -m pip install --require-hashes -r requirements.txt -CMD ["python3.8"] +CMD ["python3.10"] diff --git a/.kokoro/docker/docs/requirements.txt b/.kokoro/docker/docs/requirements.txt index 0e5d70f2..7129c771 100644 --- a/.kokoro/docker/docs/requirements.txt +++ b/.kokoro/docker/docs/requirements.txt @@ -4,9 +4,9 @@ # # pip-compile --allow-unsafe --generate-hashes requirements.in # -argcomplete==3.2.3 \ - --hash=sha256:bf7900329262e481be5a15f56f19736b376df6f82ed27576fa893652c5de6c23 \ - --hash=sha256:c12355e0494c76a2a7b73e3a59b09024ca0ba1e279fb9ed6c1b82d5b74b6a70c +argcomplete==3.4.0 \ + --hash=sha256:69a79e083a716173e5532e0fa3bef45f793f4e61096cf52b5a42c0211c8b8aa5 \ + --hash=sha256:c2abcdfe1be8ace47ba777d4fce319eb13bf8ad9dace8d085dcad6eded88057f # via nox colorlog==6.8.2 \ --hash=sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44 \ @@ -16,23 +16,27 @@ distlib==0.3.8 \ --hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \ --hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64 # via virtualenv -filelock==3.13.1 \ - --hash=sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e \ - --hash=sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c +filelock==3.15.4 \ + --hash=sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb \ + --hash=sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7 # via virtualenv -nox==2024.3.2 \ - --hash=sha256:e53514173ac0b98dd47585096a55572fe504fecede58ced708979184d05440be \ - --hash=sha256:f521ae08a15adbf5e11f16cb34e8d0e6ea521e0b92868f684e91677deb974553 +nox==2024.4.15 \ + --hash=sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565 \ + --hash=sha256:ecf6700199cdfa9e5ea0a41ff5e6ef4641d09508eda6edb89d9987864115817f # via -r requirements.in -packaging==24.0 \ - --hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \ - --hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9 +packaging==24.1 \ + --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ + --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via nox -platformdirs==4.2.0 \ - --hash=sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068 \ - --hash=sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768 +platformdirs==4.2.2 \ + --hash=sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee \ + --hash=sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3 # via virtualenv -virtualenv==20.25.1 \ - --hash=sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a \ - --hash=sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197 +tomli==2.0.1 \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f + # via nox +virtualenv==20.26.3 \ + --hash=sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a \ + --hash=sha256:8cc4a31139e796e9a7de2cd5cf2489de1217193116a8fd42328f1bd65f434589 # via nox diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 35ece0e4..9622baf0 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -20,9 +20,9 @@ cachetools==5.3.3 \ --hash=sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945 \ --hash=sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105 # via google-auth -certifi==2024.6.2 \ - --hash=sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516 \ - --hash=sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56 +certifi==2024.7.4 \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 # via requests cffi==1.16.0 \ --hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \ @@ -371,23 +371,23 @@ more-itertools==10.3.0 \ # via # jaraco-classes # jaraco-functools -nh3==0.2.17 \ - --hash=sha256:0316c25b76289cf23be6b66c77d3608a4fdf537b35426280032f432f14291b9a \ - --hash=sha256:1a814dd7bba1cb0aba5bcb9bebcc88fd801b63e21e2450ae6c52d3b3336bc911 \ - --hash=sha256:1aa52a7def528297f256de0844e8dd680ee279e79583c76d6fa73a978186ddfb \ - --hash=sha256:22c26e20acbb253a5bdd33d432a326d18508a910e4dcf9a3316179860d53345a \ - --hash=sha256:40015514022af31975c0b3bca4014634fa13cb5dc4dbcbc00570acc781316dcc \ - --hash=sha256:40d0741a19c3d645e54efba71cb0d8c475b59135c1e3c580f879ad5514cbf028 \ - --hash=sha256:551672fd71d06cd828e282abdb810d1be24e1abb7ae2543a8fa36a71c1006fe9 \ - --hash=sha256:66f17d78826096291bd264f260213d2b3905e3c7fae6dfc5337d49429f1dc9f3 \ - --hash=sha256:85cdbcca8ef10733bd31f931956f7fbb85145a4d11ab9e6742bbf44d88b7e351 \ - --hash=sha256:a3f55fabe29164ba6026b5ad5c3151c314d136fd67415a17660b4aaddacf1b10 \ - --hash=sha256:b4427ef0d2dfdec10b641ed0bdaf17957eb625b2ec0ea9329b3d28806c153d71 \ - --hash=sha256:ba73a2f8d3a1b966e9cdba7b211779ad8a2561d2dba9674b8a19ed817923f65f \ - --hash=sha256:c21bac1a7245cbd88c0b0e4a420221b7bfa838a2814ee5bb924e9c2f10a1120b \ - --hash=sha256:c551eb2a3876e8ff2ac63dff1585236ed5dfec5ffd82216a7a174f7c5082a78a \ - --hash=sha256:c790769152308421283679a142dbdb3d1c46c79c823008ecea8e8141db1a2062 \ - --hash=sha256:d7a25fd8c86657f5d9d576268e3b3767c5cd4f42867c9383618be8517f0f022a +nh3==0.2.18 \ + --hash=sha256:0411beb0589eacb6734f28d5497ca2ed379eafab8ad8c84b31bb5c34072b7164 \ + --hash=sha256:14c5a72e9fe82aea5fe3072116ad4661af5cf8e8ff8fc5ad3450f123e4925e86 \ + --hash=sha256:19aaba96e0f795bd0a6c56291495ff59364f4300d4a39b29a0abc9cb3774a84b \ + --hash=sha256:34c03fa78e328c691f982b7c03d4423bdfd7da69cd707fe572f544cf74ac23ad \ + --hash=sha256:36c95d4b70530b320b365659bb5034341316e6a9b30f0b25fa9c9eff4c27a204 \ + --hash=sha256:3a157ab149e591bb638a55c8c6bcb8cdb559c8b12c13a8affaba6cedfe51713a \ + --hash=sha256:42c64511469005058cd17cc1537578eac40ae9f7200bedcfd1fc1a05f4f8c200 \ + --hash=sha256:5f36b271dae35c465ef5e9090e1fdaba4a60a56f0bb0ba03e0932a66f28b9189 \ + --hash=sha256:6955369e4d9f48f41e3f238a9e60f9410645db7e07435e62c6a9ea6135a4907f \ + --hash=sha256:7b7c2a3c9eb1a827d42539aa64091640bd275b81e097cd1d8d82ef91ffa2e811 \ + --hash=sha256:8ce0f819d2f1933953fca255db2471ad58184a60508f03e6285e5114b6254844 \ + --hash=sha256:94a166927e53972a9698af9542ace4e38b9de50c34352b962f4d9a7d4c927af4 \ + --hash=sha256:a7f1b5b2c15866f2db413a3649a8fe4fd7b428ae58be2c0f6bca5eefd53ca2be \ + --hash=sha256:c8b3a1cebcba9b3669ed1a84cc65bf005728d2f0bc1ed2a6594a992e817f3a50 \ + --hash=sha256:de3ceed6e661954871d6cd78b410213bdcb136f79aafe22aa7182e028b8c7307 \ + --hash=sha256:f0eca9ca8628dbb4e916ae2491d72957fdd35f7a5d326b7032a345f111ac07fe # via readme-renderer nox==2024.4.15 \ --hash=sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565 \ @@ -460,9 +460,9 @@ python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 # via gcp-releasetool -readme-renderer==43.0 \ - --hash=sha256:1818dd28140813509eeed8d62687f7cd4f7bad90d4db586001c5dc09d4fde311 \ - --hash=sha256:19db308d86ecd60e5affa3b2a98f017af384678c63c88e5d4556a380e674f3f9 +readme-renderer==44.0 \ + --hash=sha256:2fbca89b81a08526aadf1357a8c2ae889ec05fb03f5da67f9769c9a592166151 \ + --hash=sha256:8712034eabbfa6805cacf1402b4eeb2a73028f72d1166d6f5cb7f9c047c5d1e1 # via twine requests==2.32.3 \ --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ From 11a52e85b3927a01706c22e9a467d960e007f29b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 9 Jul 2024 15:42:59 -0400 Subject: [PATCH 2/4] use python 3.10 for docs build --- noxfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 283135be..8fad0f8c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -42,6 +42,9 @@ "google-cloud-core", ] +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + def get_path(*names): return os.path.join(NOX_DIR, *names) @@ -262,7 +265,7 @@ def blacken(session): run_black(session) -@nox.session(py="3.9") +@nox.session(py="3.10") def docs(session): """Build the docs for this library.""" From a2c9c9fd7f80a037240a262547d97d93cc049854 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 12 Jul 2024 15:52:09 -0400 Subject: [PATCH 3/4] upgrade sphinx to 4.5.0 --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 8fad0f8c..a65ff5d3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -280,7 +280,7 @@ def docs(session): "sphinxcontrib-htmlhelp==2.0.1", "sphinxcontrib-qthelp==1.0.3", "sphinxcontrib-serializinghtml==1.1.5", - "sphinx==4.0.1", + "sphinx==4.5.0", "alabaster", "recommonmark", "sphinxcontrib.spelling", From 051a04117ef3cf5755f1c937f9e83570378c2648 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 12 Jul 2024 19:54:57 +0000 Subject: [PATCH 4/4] fix docs issues related to sphinx 4.5.0 update --- google/cloud/ndb/_datastore_types.py | 4 +- google/cloud/ndb/context.py | 4 +- google/cloud/ndb/key.py | 4 +- google/cloud/ndb/model.py | 76 ++++++++++++++-------------- google/cloud/ndb/query.py | 4 +- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/google/cloud/ndb/_datastore_types.py b/google/cloud/ndb/_datastore_types.py index f8c21860..76920409 100644 --- a/google/cloud/ndb/_datastore_types.py +++ b/google/cloud/ndb/_datastore_types.py @@ -46,8 +46,8 @@ class BlobKey(object): blob_key (Optional[bytes]): The key used for the blobstore. Raises: - .BadValueError: If the ``blob_key`` exceeds 1500 bytes. - .BadValueError: If the ``blob_key`` is not :data:`None` or a + exceptions.BadValueError: If the ``blob_key`` exceeds 1500 bytes. + exceptions.BadValueError: If the ``blob_key`` is not :data:`None` or a :class:`bytes` instance. """ diff --git a/google/cloud/ndb/context.py b/google/cloud/ndb/context.py index 90a39917..d8c47f52 100644 --- a/google/cloud/ndb/context.py +++ b/google/cloud/ndb/context.py @@ -105,7 +105,7 @@ def get_context(raise_context_error=True): Context: The current context. Raises: - .ContextError: If called outside of a context + exceptions.ContextError: If called outside of a context established by :meth:`google.cloud.ndb.client.Client.context` and ``raise_context_error`` is :data:`True`. """ @@ -139,7 +139,7 @@ def get_toplevel_context(raise_context_error=True): Context: The current context. Raises: - .ContextError: If called outside of a context + exceptions.ContextError: If called outside of a context established by :meth:`google.cloud.ndb.client.Client.context` and ``raise_context_error`` is :data:`True`. """ diff --git a/google/cloud/ndb/key.py b/google/cloud/ndb/key.py index 7252f9e2..3c3af888 100644 --- a/google/cloud/ndb/key.py +++ b/google/cloud/ndb/key.py @@ -1408,7 +1408,7 @@ def _parse_from_args( ~.datastore.Key: The constructed key. Raises: - .BadValueError: If ``parent`` is passed but is not a ``Key``. + exceptions.BadValueError: If ``parent`` is passed but is not a ``Key``. """ # Avoid circular import in Python 2.7 from google.cloud.ndb import context as context_module @@ -1514,7 +1514,7 @@ def _clean_flat_path(flat): Raises: TypeError: If the kind in a pair is an invalid type. - .BadArgumentError: If a key ID is :data:`None` (indicating a partial + exceptions.BadArgumentError: If a key ID is :data:`None` (indicating a partial key), but in a pair other than the last one. TypeError: If a key ID is not a string or integer. """ diff --git a/google/cloud/ndb/model.py b/google/cloud/ndb/model.py index 317c99a7..acfd10a8 100644 --- a/google/cloud/ndb/model.py +++ b/google/cloud/ndb/model.py @@ -1487,7 +1487,7 @@ def _set_value(self, entity, value): Raises: ReadonlyPropertyError: If the ``entity`` is the result of a projection query. - .BadValueError: If the current property is repeated but the + exceptions.BadValueError: If the current property is repeated but the ``value`` is not a basic container (:class:`list`, :class:`tuple`, :class:`set` or :class:`frozenset`). """ @@ -2258,15 +2258,15 @@ def _validate_key(value, entity=None): """Validate a key. Args: - value (.Key): The key to be validated. + value (~google.cloud.ndb.key.Key): The key to be validated. entity (Optional[Model]): The entity that the key is being validated for. Returns: - .Key: The passed in ``value``. + ~google.cloud.ndb.key.Key: The passed in ``value``. Raises: - .BadValueError: If ``value`` is not a :class:`.Key`. + exceptions.BadValueError: If ``value`` is not a :class:`~google.cloud.ndb.key.Key`. KindError: If ``entity`` is specified, but the kind of the entity doesn't match the kind of ``value``. """ @@ -2315,7 +2315,7 @@ def _comparison(self, op, value): comparison. Raises: - .BadValueError: If ``value`` is :data:`None`. + exceptions.BadValueError: If ``value`` is :data:`None`. """ if value is not None: return super(ModelKey, self)._comparison(op, value) @@ -2326,10 +2326,10 @@ def _validate(self, value): """Validate a ``value`` before setting it. Args: - value (.Key): The value to check. + value (~google.cloud.ndb.key.Key): The value to check. Returns: - .Key: The passed-in ``value``. + ~google.cloud.ndb.key.Key: The passed-in ``value``. """ return _validate_key(value) @@ -2339,7 +2339,7 @@ def _set_value(entity, value): Args: entity (Model): An entity to set the entity key on. - value (.Key): The key to be set on the entity. + value (~google.cloud.ndb.key.Key): The key to be set on the entity. """ if value is not None: value = _validate_key(value, entity=entity) @@ -2355,7 +2355,7 @@ def _get_value(entity): entity (Model): An entity to get the entity key from. Returns: - .Key: The entity key stored on ``entity``. + ~google.cloud.ndb.key.Key: The entity key stored on ``entity``. """ return entity._entity_key @@ -2385,7 +2385,7 @@ def _validate(self, value): bool: The passed-in ``value``. Raises: - .BadValueError: If ``value`` is not a :class:`bool`. + exceptions.BadValueError: If ``value`` is not a :class:`bool`. """ if not isinstance(value, bool): raise exceptions.BadValueError( @@ -2431,7 +2431,7 @@ def _validate(self, value): int: The passed-in ``value``. Raises: - .BadValueError: If ``value`` is not an :class:`int` or convertible + exceptions.BadValueError: If ``value`` is not an :class:`int` or convertible to one. """ if not isinstance(value, int): @@ -2463,7 +2463,7 @@ def _validate(self, value): :class:`float`. Raises: - .BadValueError: If ``value`` is not a :class:`float` or convertible + exceptions.BadValueError: If ``value`` is not a :class:`float` or convertible to one. """ if not isinstance(value, (float, int)): @@ -2595,8 +2595,8 @@ def _validate(self, value): value (bytes): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`bytes`. - .BadValueError: If the current property is indexed but the value + exceptions.BadValueError: If ``value`` is not a :class:`bytes`. + exceptions.BadValueError: If the current property is indexed but the value exceeds the maximum length (1500 bytes). """ if not isinstance(value, bytes): @@ -2776,11 +2776,11 @@ def _validate(self, value): value (Union[bytes, str]): The value to check. Raises: - .BadValueError: If ``value`` is :class:`bytes`, but is not a valid + exceptions.BadValueError: If ``value`` is :class:`bytes`, but is not a valid UTF-8 encoded string. - .BadValueError: If ``value`` is neither :class:`bytes` nor + exceptions.BadValueError: If ``value`` is neither :class:`bytes` nor :class:`str`. - .BadValueError: If the current property is indexed but the UTF-8 + exceptions.BadValueError: If the current property is indexed but the UTF-8 encoded value exceeds the maximum length (1500 bytes). """ if not isinstance(value, str): @@ -2938,11 +2938,11 @@ def _validate(self, value): value (Union[bytes, str]): The value to check. Raises: - .BadValueError: If ``value`` is :class:`bytes`, but is not a valid + exceptions.BadValueError: If ``value`` is :class:`bytes`, but is not a valid UTF-8 encoded string. - .BadValueError: If ``value`` is neither :class:`bytes` nor + exceptions.BadValueError: If ``value`` is neither :class:`bytes` nor :class:`str`. - .BadValueError: If the current property is indexed but the UTF-8 + exceptions.BadValueError: If the current property is indexed but the UTF-8 encoded value exceeds the maximum length (1500 bytes). """ if isinstance(value, bytes): @@ -3056,7 +3056,7 @@ def _validate(self, value): check. Raises: - .BadValueError: If ``value`` is not a :attr:`.GeoPt`. + exceptions.BadValueError: If ``value`` is not a :attr:`.GeoPt`. """ if not isinstance(value, GeoPt): raise exceptions.BadValueError( @@ -3478,7 +3478,7 @@ def _validate(self, value): value (User): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`User`. + exceptions.BadValueError: If ``value`` is not a :class:`User`. """ # Might be GAE User or our own version if type(value).__name__ != "User": @@ -3552,7 +3552,7 @@ def _to_datastore(self, entity, data, prefix="", repeated=False): class KeyProperty(Property): - """A property that contains :class:`.Key` values. + """A property that contains :class:`~google.cloud.ndb.key.Key` values. The constructor for :class:`KeyProperty` allows at most two positional arguments. Any usage of :data:`None` as a positional argument will @@ -3595,10 +3595,10 @@ class SimpleModel(ndb.Model): multiple values. required (bool): Indicates if this property is required on the given model type. - default (.Key): The default value for this property. - choices (Iterable[.Key]): A container of allowed values for this + default (~google.cloud.ndb.key.Key): The default value for this property. + choices (Iterable[~google.cloud.ndb.key.Key]): A container of allowed values for this property. - validator (Callable[[~google.cloud.ndb.model.Property, .Key], bool]): A + validator (Callable[[~google.cloud.ndb.model.Property, ~google.cloud.ndb.key.Key], bool]): A validator to be used to check values. verbose_name (str): A longer, user-friendly name for this property. write_empty_list (bool): Indicates if an empty list should be written @@ -3686,13 +3686,13 @@ def _validate(self, value): """Validate a ``value`` before setting it. Args: - value (.Key): The value to check. + value (~google.cloud.ndb.key.Key): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`.Key`. - .BadValueError: If ``value`` is a partial :class:`.Key` (i.e. it + exceptions.BadValueError: If ``value`` is not a :class:`.Key`. + exceptions.BadValueError: If ``value`` is a partial :class:`.Key` (i.e. it has no name or ID set). - .BadValueError: If the current property has an associated ``kind`` + exceptions.BadValueError: If the current property has an associated ``kind`` and ``value`` does not match that kind. """ if not isinstance(value, Key): @@ -3758,7 +3758,7 @@ def _validate(self, value): value (~google.cloud.ndb.model.BlobKey): The value to check. Raises: - .BadValueError: If ``value`` is not a + exceptions.BadValueError: If ``value`` is not a :class:`~google.cloud.ndb.model.BlobKey`. """ if not isinstance(value, BlobKey): @@ -3877,7 +3877,7 @@ def _validate(self, value): value (~datetime.datetime): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`~datetime.datetime`. + exceptions.BadValueError: If ``value`` is not a :class:`~datetime.datetime`. """ if not isinstance(value, datetime.datetime): raise exceptions.BadValueError( @@ -3976,7 +3976,7 @@ def _validate(self, value): value (~datetime.date): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`~datetime.date`. + exceptions.BadValueError: If ``value`` is not a :class:`~datetime.date`. """ if not isinstance(value, datetime.date): raise exceptions.BadValueError( @@ -4036,7 +4036,7 @@ def _validate(self, value): value (~datetime.time): The value to check. Raises: - .BadValueError: If ``value`` is not a :class:`~datetime.time`. + exceptions.BadValueError: If ``value`` is not a :class:`~datetime.time`. """ if not isinstance(value, datetime.time): raise exceptions.BadValueError( @@ -4440,7 +4440,7 @@ def _validate(self, value): Args: value: The value to check. Raises: - .BadValueError: If ``value`` is not a given class. + exceptions.BadValueError: If ``value`` is not a given class. """ if isinstance(value, dict): # A dict is assumed to be the result of a _to_dict() call. @@ -4869,7 +4869,7 @@ class MyModel(ndb.Model): to properties of this model. Raises: - .BadArgumentError: If the constructor is called with ``key`` and one + exceptions.BadArgumentError: If the constructor is called with ``key`` and one of ``id``, ``app``, ``namespace``, ``database``, or ``parent`` specified. """ @@ -5371,10 +5371,10 @@ def _validate_key(key): """Validation for ``_key`` attribute (designed to be overridden). Args: - key (.Key): Proposed key to use for this entity. + key (~google.cloud.ndb.key.Key): Proposed key to use for this entity. Returns: - .Key: The validated ``key``. + ~google.cloud.ndb.key.Key: The validated ``key``. """ return key diff --git a/google/cloud/ndb/query.py b/google/cloud/ndb/query.py index 76066b75..76731ede 100644 --- a/google/cloud/ndb/query.py +++ b/google/cloud/ndb/query.py @@ -338,7 +338,7 @@ def resolve(self, bindings, used): Any: The bound value for the current parameter. Raises: - .BadArgumentError: If the current parameter is not in ``bindings``. + exceptions.BadArgumentError: If the current parameter is not in ``bindings``. """ key = self._key if key not in bindings: @@ -565,7 +565,7 @@ def _to_filter(self, post=False): post (bool): Indicates if this is a post-filter node. Raises: - .BadArgumentError: Always. This is because this node represents + exceptions.BadArgumentError: Always. This is because this node represents a parameter, i.e. no value exists to be filtered on. """ raise exceptions.BadArgumentError(