GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Implement datastore v1beta3 · Issue #1288 · googleapis/google-cloud-python

Implement datastore v1beta3 #1288

New issue
Copy link
New issue
Copy link
Closed
Closed
Implement datastore v1beta3#1288
Copy link
Assignees
dhermes
Labels
api: datastoreIssues related to the Datastore API.

Description

@dhermes
dhermes
opened on Dec 15, 2015
Issue body actions

Current plan of attack:

  • Remove --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) from "helper" modules that don't use gRPC (e.g. google.bigtable.v1.bigtable_data) (this way sub-packages that don't need gRPC can use them) (Updating Makefile to only use gRPC when needed. #1354)
  • Ditch shared generated modules for those included with protobuf and googleapis-common-protos (Use googleapis common protos #1353) Move shared (i.e. non-Bigtable specific) modules from gcloud.bigtable._generated to gcloud._generated (this way all sub-packages can have access to shared protobuf message classes) and then subsequently update the bigtable imports to accommodate this change
  • Pull out _get_pb_property_value in gcloud.bigtable.cluster into core (gcloud._helpers) and separate out a _has_field piece since pb_message.HasField doesn't work on non-message fields in proto3 (Moving _get_pb_property_value from bigtable into core. #1329)
  • Update Makefile to reflect changes above (i.e. make sure it can be run without changing the code) (See Bringing auto-gen import re-writing up to date with files. #1316)
  • Update Makefile to automatically add the _foo.proto files to the repo (See Making pb2 auto-gen script also copy over .proto files. #1317)
  • Fold Batch.add_auto_id_entity into Batch.put (the auto_id_entity mutation is removed in favor of just using insert with a partial key) (see Removing datastore Batch.add_auto_id_entity. #1296)
  • Loosen Batch implementation's reliance on Mutation message class (it is used in a LookupRequest and their combined structure changes in v1beta3) (See Renaming datastore Batch.mutation to mutations. #1306, Puting helpers in datastore Batch for getting new mutations. #1319, Using protobuf CommitRequest in datastore Connection.commit. #1341)
  • Remove use of serializable in Client.transaction and Transaction (it is no longer an option in v1beta3, so we will curtail it's use in v1beta2 before the switch) (See Removing serializable option from datastore Transaction. #1294)
  • Manually partition the _datastore_v1_pb2.py module into 3 modules that just import portions of the namespace. These modules (datastore_pb2.py, entity_pb2.py, query_pb2.py) will be according to the membership in the new proto definitions for v1beta3. (See Replacing datastore pb uses with entity shim. #1297, Replacing datastore pb uses with query shim. #1299, Replacing datastore pb uses with "datastore" shim. #1301, Creating _generated pb directory for datastore #1328)
  • Switch over imports from directly using _datastore_v1_pb2.py to using our "shim" imports to mock the structure of v1beta3. (See Replacing datastore pb uses with entity shim. #1297, Replacing datastore pb uses with query shim. #1299, Replacing datastore pb uses with "datastore" shim. #1301, Creating _generated pb directory for datastore #1328)
  • Make sure API_BASE_URL for the Connection class is used (rather than a parent's version) (See Explicitly using API_BASE_URL from current connection in datastore. #1293)
  • Change Client.dataset_id to Client.project (in advance of the rename to PartitionId.project_id in v1beta3) (Replace dataset id with project in datastore #1330)
  • Change the return type of Connection.commit to be a tuple of index_updates and mutation_results (they were previously on the same result object but are being split apart in v1beta3) (See Reducing datastore commit reliance on structure of response. #1314)
  • Replace uses of HasField for non-message values with _has_field (see above) (Moving _get_pb_property_value from bigtable into core. #1329)
  • Remove v1beta2 generated pb2 file and old .proto definition (can also remove _datastore_v1_pb2.py from the pylintrc_default ignored file) and delete our "shim" modules (Upgrading Makefile to generate datastore v1beta3. #1355, Upgrading Makefile to generate datastore v1beta3. #1428)
  • Update Makefile to incorporate protobuf definitions for v1beta3 (I did this in a side-project, Use googleapis common protos #1353, Updating Makefile to only use gRPC when needed. #1354, Upgrading Makefile to generate datastore v1beta3. #1355, Upgrading Makefile to generate datastore v1beta3. #1428)
  • Rewrite our "shim" imports to use the actual datastore._generated files for v1beta3.
  • Switch API_BASE_URL from https://www.googleapis.com to https://datastore.googleapis.com and drop 'https://www.googleapis.com/auth/userinfo.email from the scope list (Updating datastore URI template for v1beta3. #1339, Updating datastore URI template for v1beta3. #1406)
  • Accommodate renames / retyped / removed
    • CommitRequest.mutation --> CommitRequest.mutations (Updating CommitRequest, Mutation and helpers for v1beta3. #1461)
    • LookupRequest.key --> LookupRequest.keys (Handling datastore renames key -> keys #1358, Handling datastore renames key -> keys #1456)
    • AllocateIdsResponse.key --> AllocateIdsResponse.keys (Handling datastore renames key -> keys #1358, Handling datastore renames key -> keys #1456)
    • AllocateIdsRequest.key --> AllocateIdsRequest.keys (Handling datastore renames key -> keys #1358, Handling datastore renames key -> keys #1456)
    • Key.path_element --> Key.path (Renaming path_element->path in Key. #1360, Renaming path_element->path in Key. #1457)
    • Entity.property --> Entity.properties (Upgrading Entity.property to properties map in datastore. #1458)
    • Query.group_by --> Query.distinct_on (Handling datastore renames on Query and QueryResultBatch. #1357, Handling datastore renames on Query and QueryResultBatch. #1455)
    • Query.limit --> Query.limit.value (Handling datastore renames on Query and QueryResultBatch. #1357, Handling datastore renames on Query and QueryResultBatch. #1455)
    • QueryResultBatch.entity_result --> QueryResultBatch.entity_results (Handling datastore renames on Query and QueryResultBatch. #1357, Handling datastore renames on Query and QueryResultBatch. #1455)
    • PartitionId.namespace --> PartitionId.namespace_id (Handle datastore renames on PartitionId #1359, Handle datastore renames on PartitionId #1452)
    • PartitionId.dataset_id --> PartitionId.project_id (Handle datastore renames on PartitionId #1359, Handle datastore renames on PartitionId #1452)
    • Value.indexed --> Value.exclude_from_indexes (Rename Value.indexed->exclude_from_indexes. #1365, Rename Value.indexed->exclude_from_indexes. #1453)
    • Value.list_value --> Value.array_value (Upgrading list_value -> array_value for v1beta3. #1460)
    • Value.null_value added (Adding support for null and geo point values in v1beta3. #1464)
    • Value.timestamp_microseconds_value --> Value.timestamp_value (with type change) (Moving _pb_timestamp_to_datetime into core. #1361, Upgrading timestamp_microseconds_value to timestamp_value. #1459)
    • Value.geo_point_value added (Adding support for null and geo point values in v1beta3. #1464)
    • Value.blob_key_value removed
    • CompositeFilter.filter --> CompositeFilter.filters (Handling datastore renames on CompositeFilter and PropertyFilter. #1356, Handling datastore renames on CompositeFilter and PropertyFilter. #1454)
    • CompositeFilter.operation --> CompositeFilter.op (Handling datastore renames on CompositeFilter and PropertyFilter. #1356, Handling datastore renames on CompositeFilter and PropertyFilter. #1454)
    • PropertyFilter.operation --> PropertyFilter.op (Handling datastore renames on CompositeFilter and PropertyFilter. #1356, Handling datastore renames on CompositeFilter and PropertyFilter. #1454)
    • CompositeFilter.AND --> CompositeFilter.OPERATOR_UNSPECIFIED (as default value) (Handling datastore renames on CompositeFilter and PropertyFilter. #1356, Handling datastore renames on CompositeFilter and PropertyFilter. #1454)
    • ReadOptions.DEFAULT --> ReadOptions.READ_CONSISTENCY_UNSPECIFIED (as default value) (Handling datastore renames on CompositeFilter and PropertyFilter. #1356, Handling datastore renames on CompositeFilter and PropertyFilter. #1454)
  • Deal with the fact that Entity.property is not a map called Entity.properties (somewhat different semantics) (Adding helpers for interacting with properties in Entity protobuf. #1340)
  • Tear out dataset (project) prefix code (Removing hacks that avoid using project ID in key protos. #1466)
  • Re-vamp environment variable usage (dataset_id no longer needed?) (Removing custom dataset ID environment variable. #1465)
  • Remove use of isolation_level in Connection.begin_transaction (Removing use of isolation level in datastore. #1343, Removing use of isolation level in datastore. #1407)

New Features:

  • Add GqlQuery support (Missing GQL support #304)
  • QueryResultBatch.skipped_cursor added (only set when skipped_results != 0)
  • EntityResult.cursor added (set by the backend when the entity result is part of a RunQueryResponse.batch.entity_results response)
  • Parse protobuf errors

Activity

Next
  1. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    on Dec 15, 2015
  2. pcostell commented on Dec 15, 2015

    @pcostell
    pcostell
    on Dec 15, 2015
    Contributor
    More actions

    All those project IDs have already been whitelisted for the API.

    Just double checking that this is a typo in the issue, but the correct url is:

    https://datastore.googleapis.com/v1beta3/projects/omega-moonlight-697:runQuery
    
  3. dhermes commented on Dec 15, 2015

    @dhermes
    dhermes
    on Dec 15, 2015
    ContributorAuthor
    More actions

    D'oh! Thought I changed it! Thanks for the keen eye

  4. dhermes commented on Dec 15, 2015

    @dhermes
    dhermes
    on Dec 15, 2015
    ContributorAuthor
    More actions

    Culprit found, the constructor was relying on the connection base class (non-datastore specific)

    from gcloud import connection
    ...
            if api_base_url is None:
                api_base_url = os.getenv(GCD_HOST,
                                         connection.API_BASE_URL)
  5. dhermes commented on Dec 16, 2015

    @dhermes
    dhermes
    on Dec 16, 2015
    ContributorAuthor
    More actions

    For posterity, here is the "retired" original description:


    pcostell I believe I am "done" updating for v1beta3 but am getting 404s when running the system tests with both

    https://www.googleapis.com/v1beta3/projects/omega-moonlight-697:runQuery
    https://www.googleapis.com/v1beta3/projects/s~omega-moonlight-697:runQuery
    

    I think it requires a whitelist at this point to use v1beta3? I seem to remember a whitelist discussion but can't find any evidence of this.

    Project IDs:

    omega-moonlight-697
    precise-truck-742
    citric-celerity-697
    

    /cc tseaver

  6. dhermes
    added 4 commits that reference this issue on Jan 3, 2016

    Using protobuf CommitRequest in datastore Connection.commit.

    a1194f5

    Upgrading Entity.property to properties map in datastore.

    1463763

    Rename Value.indexed->exclude_from_indexes.

    beffdc5

    Using protobuf CommitRequest in datastore Connection.commit.

    7f1b786
  7. dhermes
    added 2 commits that reference this issue on Jan 15, 2016

    Rename Value.indexed->exclude_from_indexes.

    219d368

    Upgrading Entity.property to properties map in datastore.

    c2ccc40
  8. dhermes
    added 2 commits that reference this issue on Feb 12, 2016

    Rename Value.indexed->exclude_from_indexes.

    00dc427

    Upgrading Entity.property to properties map in datastore.

    fe38f6a
  9. dhermes commented on Feb 18, 2016

    @dhermes
    dhermes
    on Feb 18, 2016
    ContributorAuthor
    More actions

    FYI @jgeewax @tseaver I just did a merge of master in the datastore-v1beta3 branch. I don't know of a better place to surface such comments. Just wanted to keep them in sync / catch any merge conflicts before the happen. Merged perfectly with no issues!

  10. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    Another FYI, just did another merge. Only one merge conflict in system_tests/run_system_test.py (due to Bigtable modifying REQUIREMENTS and datastore-v1beta3 just removing it as a variable). Merge conflict easily resolved and merge completed.

  11. 13 remaining items

  12. dhermes commented on Mar 29, 2016

    @dhermes
    dhermes
    on Mar 29, 2016
    ContributorAuthor
    More actions
    1. Merge the datastore-v1beta3 branch into master
    2. Send a PR to update the version in setup.py
    3. Push a new tag with the version (Travis pushes to PyPI on tag builds)
  13. pcostell commented on Apr 1, 2016

    @pcostell
    pcostell
    on Apr 1, 2016
    Contributor
    More actions

    @dhermes We are ready for you to merge this in and push to pypi.

  14. dhermes commented on Apr 1, 2016

    @dhermes
    dhermes
    on Apr 1, 2016
    ContributorAuthor
    More actions

    w00t.

  15. dhermes commented on Apr 1, 2016

    @dhermes
    dhermes
    on Apr 1, 2016
    ContributorAuthor
    More actions

    Did my final merge of master into datastore-v1beta3. Only conflict was in run_system_tests.py (as predicted).

  16. dhermes
    closed this as completedin #1688on Apr 1, 2016
  17. tseaver commented on Apr 4, 2016

    @tseaver
    tseaver
    on Apr 4, 2016
    Contributor
    More actions

    @pcostell I can't seem to enable the v1beta3 API. I have added you as an owner to my project: can you figure out what I screwed up?

  18. pcostell commented on Apr 4, 2016

    @pcostell
    pcostell
    on Apr 4, 2016
    Contributor
    More actions

    @tseaver There is an (unfortunately timed) issue with the API service causing this issue. In particular if you disable Datastore v1beta2 (and potentially other APIs), you get left in state where you can't enable APIs. I'll follow up when I get more details.

  19. tseaver commented on Apr 4, 2016

    @tseaver
    tseaver
    on Apr 4, 2016
    Contributor
    More actions

    @pcostell thanks for looking into it.

  20. pcostell commented on Apr 4, 2016

    @pcostell
    pcostell
    on Apr 4, 2016
    Contributor
    More actions

    googleapis/google-cloud-datastore#97

  21. tseaver commented on Apr 5, 2016

    @tseaver
    tseaver
    on Apr 5, 2016
    Contributor
    More actions

    @pcostell Thank you -- whatever you did for the user in that issue seems to have worked for me, too.

  22. JustinBeckwith
    assigned
    dhermes
    on Feb 1, 2021
  23. parthea
    added a commit that references this issue on Sep 22, 2023

    docs: add samples from python-docs-samples/tasks (#36)

    19a15ff
  24. parthea
    added a commit that references this issue on Mar 2, 2026

    fix: Mark test_streaming_pull_max_messages flaky (#1288)

    d0fe8fd
  25. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    feat: add OpenTelemetry Tracing support as a preview feature (#1288)

    7ca369a

    chore(python): exclude .github/workflows/unittest.yml in renovate con…

    88f4e59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.