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

feat: add datastore aggregation query APIs #306

Merged
merged 41 commits into from Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f46a89e
chore: use gapic-generator-python 0.65.2
gcf-owl-bot[bot] Apr 27, 2022
beeb312
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 27, 2022
30192fc
docs: Document encoding of non-UTF-8 key strings in the Cloud Datasto…
gcf-owl-bot[bot] May 23, 2022
20fe09f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 23, 2022
11cecc4
chore: use gapic-generator-python 1.0.0
gcf-owl-bot[bot] May 27, 2022
8213569
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] May 27, 2022
5f15d82
docs: clarifications for `DatastoreFirestoreMigraitonMetadata`
gcf-owl-bot[bot] Jun 1, 2022
9ab4e96
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 1, 2022
46d9d40
feat: add audience parameter
gcf-owl-bot[bot] Jun 23, 2022
282d431
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jun 23, 2022
9964863
chore: use gapic-generator-python 1.1.1
gcf-owl-bot[bot] Jul 5, 2022
eb664f6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 5, 2022
e96704b
fix(deps): require google-api-core 2.8.0
parthea Jul 7, 2022
1192eba
Merge remote-tracking branch 'origin/main' into owl-bot-copy
parthea Jul 10, 2022
aed905d
fix(deps): require google-api-core>=1.32.0,>=2.8.0
parthea Jul 15, 2022
7cb3626
Merge branch 'main' into owl-bot-copy
parthea Jul 15, 2022
a9bc419
feat: Add "or" query support (only in the preview API surface)
gcf-owl-bot[bot] Jul 21, 2022
8e878eb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 21, 2022
e5e04b4
chore(bazel): update protobuf to v3.21.3
gcf-owl-bot[bot] Jul 25, 2022
2464795
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 25, 2022
5c4a61d
chore: use gapic-generator-python 1.2.0
gcf-owl-bot[bot] Aug 12, 2022
074e819
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Aug 12, 2022
c789bbf
chore: update count up_to field type in aggregation queries
gcf-owl-bot[bot] Aug 24, 2022
685b6d0
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Aug 24, 2022
3c8f98b
feat: Bump gapic-generator-python version to 1.3.0
gcf-owl-bot[bot] Sep 7, 2022
3013fe1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 7, 2022
8854898
chore: use gapic-generator-python 1.3.1
gcf-owl-bot[bot] Sep 7, 2022
91911d8
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 7, 2022
e6aa18c
fix: integrate gapic-generator-python-1.4.1 and enable more py_test …
gcf-owl-bot[bot] Sep 13, 2022
f3fa50e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 13, 2022
7b02739
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 13, 2022
954af5d
Merge branch 'owl-bot-copy' of https://github.com/googleapis/python-d…
gcf-owl-bot[bot] Sep 13, 2022
1aa78f3
feat: add datastore aggregation query APIs
gcf-owl-bot[bot] Sep 30, 2022
db4122e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 30, 2022
74fe47b
Merge branch 'main' into owl-bot-copy
Mariatta Oct 3, 2022
8e657ae
Merge branch 'main' into owl-bot-copy
Mariatta Oct 3, 2022
85f8d7f
Remove the tests directory from noxfile mypy session
Mariatta Oct 4, 2022
dc19213
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 4, 2022
5aad78c
Update owlbot for mypy session.
Mariatta Oct 4, 2022
76267eb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 4, 2022
5c80dc4
Merge branch 'main' into owl-bot-copy
Mariatta Oct 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -287,11 +287,18 @@ async def export_entities(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_export_entities():
async def sample_export_entities():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ExportEntitiesRequest(
Expand All @@ -304,7 +311,7 @@ def sample_export_entities():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -409,6 +416,14 @@ def sample_export_entities():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -450,11 +465,18 @@ async def import_entities(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_import_entities():
async def sample_import_entities():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ImportEntitiesRequest(
Expand All @@ -467,7 +489,7 @@ def sample_import_entities():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -540,9 +562,6 @@ def sample_import_entities():
}
The JSON representation for Empty is empty JSON
object {}.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
Expand Down Expand Up @@ -576,6 +595,14 @@ def sample_import_entities():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -621,11 +648,18 @@ async def create_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_create_index():
async def sample_create_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.CreateIndexRequest(
Expand All @@ -636,7 +670,7 @@ def sample_create_index():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -671,6 +705,14 @@ def sample_create_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -715,11 +757,18 @@ async def delete_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_delete_index():
async def sample_delete_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.DeleteIndexRequest(
Expand All @@ -730,7 +779,7 @@ def sample_delete_index():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -765,6 +814,17 @@ def sample_delete_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("index_id", request.index_id),
)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -796,18 +856,25 @@ async def get_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_get_index():
async def sample_get_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.GetIndexRequest(
)
# Make the request
response = client.get_index(request=request)
response = await client.get_index(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -847,6 +914,17 @@ def sample_get_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("index_id", request.index_id),
)
),
)

# Send the request.
response = await rpc(
request,
Expand All @@ -873,11 +951,18 @@ async def list_indexes(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_list_indexes():
async def sample_list_indexes():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ListIndexesRequest(
Expand All @@ -887,7 +972,7 @@ def sample_list_indexes():
page_result = client.list_indexes(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -930,6 +1015,14 @@ def sample_list_indexes():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down