Skip to content

query.fetch() fails if GOOGLE_CLOUD_DISABLE_GRPC is set #124

@tomthorogood

Description

@tomthorogood

This new behavior causes an error: run_query() got an unexpected keyword argument 'request' because when the GOOGLE_CLOUD_DISABLE_GRPC environment variable is set (which is a requirement in some runtimes, e.g., when using gunicorn with gevent), the underlying HTTPDatastoreAPI#run_query method does not accept a request parameter.

Example:

# run_query.py

from google.cloud import datastore

client = datastore.Client()  # Assuming an auth'd environment
results = [entity for entity in client.query(kind="Foo").fetch()]

I feel like this can be fixed by updating the signature for the HTTPDatastoreAPI#run_query to accept request and only subsequently build the request object if it's not passed in, so that the signatures match for all implementations.

Metadata

Metadata

Labels

api: datastoreIssues related to the googleapis/python-datastore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions