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

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

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.

Activity

  1. added
    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.
    and removed
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Dec 8, 2020
  2. tseaver commented on Dec 9, 2020

    @tseaver
    Contributor

    @tomthorogood Thanks for the report!

    @crwilcox We need to set up CI (maybe periodic, rather than precommit?) to exercise the library with GOOGLE_CLOUD_DISABLE_GRPC set.

  3. crwilcox commented on Dec 9, 2020

    @crwilcox
    Contributor
  4. tseaver commented on Dec 9, 2020

    @tseaver
    Contributor

    Note that we have a broader issue here: all of the methods of the HTTPDatastoreAPI need to be updated to match the request-only pattern of the new GRPC API.

  5. tseaver commented on Dec 9, 2020

    @tseaver
    Contributor

    The HTTPDatastoreAPI is also missing reserve_ids. :(

  6. tomthorogood commented on Feb 12, 2021

    @tomthorogood
    Author

    I am so sorry, I only just saw that this was resolved. Thank you so much! I really appreciate it.

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

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