Skip to content

Commit 4615969

Browse files
committed
update yaml to patch datastore __init__ file
1 parent 2e94966 commit 4615969

2 files changed

Lines changed: 72 additions & 2 deletions

File tree

.librarian/generator-input/client-post-processing/datastore-integration.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,73 @@ replacements:
124124
:maxdepth: 2
125125
126126
changelog
127+
count: 1
128+
- paths: [
129+
"packages/google-cloud-datastore/google/cloud/datastore/__init__.py",
130+
]
131+
before: |
132+
from google.cloud.datastore import gapic_version as package_version
133+
[\s\S]*?"PlanSummary",\n\)
134+
after: |
135+
"""Shortcut methods for getting set up with Google Cloud Datastore.
136+
137+
You'll typically use these to get started with the API:
138+
139+
.. doctest:: constructors
140+
141+
>>> from google.cloud import datastore
142+
>>>
143+
>>> client = datastore.Client()
144+
>>> key = client.key('EntityKind', 1234)
145+
>>> key
146+
<Key('EntityKind', 1234), project=...>
147+
>>> entity = datastore.Entity(key)
148+
>>> entity['question'] = u'Life, universe?' # Explicit unicode for text
149+
>>> entity['answer'] = 42
150+
>>> entity
151+
<Entity('EntityKind', 1234) {'question': 'Life, universe?', 'answer': 42}>
152+
>>> query = client.query(kind='EntityKind')
153+
154+
The main concepts with this API are:
155+
156+
- :class:`~google.cloud.datastore.client.Client`
157+
which represents a project (string), database (string), and namespace
158+
(string) bundled with a connection and has convenience methods for
159+
constructing objects with that project/database/namespace.
160+
161+
- :class:`~google.cloud.datastore.entity.Entity`
162+
which represents a single entity in the datastore
163+
(akin to a row in relational database world).
164+
165+
- :class:`~google.cloud.datastore.key.Key`
166+
which represents a pointer to a particular entity in the datastore
167+
(akin to a unique identifier in relational database world).
168+
169+
- :class:`~google.cloud.datastore.query.Query`
170+
which represents a lookup or search over the rows in the datastore.
171+
172+
- :class:`~google.cloud.datastore.transaction.Transaction`
173+
which represents an all-or-none transaction and enables consistency
174+
when race conditions may occur.
175+
"""
176+
177+
from google.cloud.datastore.batch import Batch
178+
from google.cloud.datastore.client import Client
179+
from google.cloud.datastore.entity import Entity
180+
from google.cloud.datastore.key import Key
181+
from google.cloud.datastore.query import Query
182+
from google.cloud.datastore.query_profile import ExplainOptions
183+
from google.cloud.datastore.transaction import Transaction
184+
from google.cloud.datastore.version import __version__
185+
186+
__all__ = [
187+
"__version__",
188+
"Batch",
189+
"Client",
190+
"Entity",
191+
"Key",
192+
"Query",
193+
"ExplainOptions",
194+
"Transaction",
195+
]
127196
count: 1

packages/google-cloud-datastore/google/cloud/datastore/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright 2014 Google LLC
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -11,7 +12,7 @@
1112
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
# See the License for the specific language governing permissions and
1314
# limitations under the License.
14-
15+
#
1516
"""Shortcut methods for getting set up with Google Cloud Datastore.
1617
1718
You'll typically use these to get started with the API:

0 commit comments

Comments
 (0)