Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

fix: request paramter error when grpc disable - #132

Closed
HemangChothani wants to merge 1 commit into
googleapis:masterfrom
MaxxleLLC:datastore_issue_124
Closed

HemangChothani wants to merge 1 commit into
googleapis:masterfrom
MaxxleLLC:datastore_issue_124

Conversation

@HemangChothani

Copy link
Copy Markdown
Contributor

Fixes #124

@HemangChothani
HemangChothani requested review from a team, crwilcox and tseaver December 8, 2020 12:56
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 8, 2020
@product-auto-label product-auto-label Bot added the api: datastore Issues related to the googleapis/python-datastore API. label Dec 8, 2020
Comment on lines -184 to +190
self, project_id, partition_id, read_options=None, query=None, gql_query=None
self,
project_id=None,
partition_id=None,
read_options=None,
query=None,
gql_query=None,
request=None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not part of the public API for the library, and its only caller is google.cloud.datastore.query.Iterator._next_page, which passes only request as a dict, and optionally retry / timeout. So, we should simplify:

    def run_query(self, request, retry=None, timeout=None):

Comment thread tests/unit/test__http.py
self.assertEqual(request.partition_id, partition_id._pb)
self.assertEqual(request.query, query_pb._pb)

def test_run_query_w_request_as_dict(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please factor out repeated setup code into helper methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: datastore Issues related to the googleapis/python-datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query.fetch() fails if GOOGLE_CLOUD_DISABLE_GRPC is set

2 participants