镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

JSON serialization should include key and url_safe_key ? #2206

Closed

Description

@jgeewax

Apparently the entity default JSON serialization excludes the key and url_safe key.

According to a customer "Both of those are super useful, and IMO are parts of the datastructure, not internal. "

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: datastoreIssues related to the Datastore API.
    on Aug 26, 2016
  2. tseaver commented on Aug 26, 2016

    @tseaver
    Contributor

    AFAIK, datastore doesn't use / render / speak JSON: the API is either protobuf-over-HTTP or protobuf-over-gRPC.

    $ git grep -i json gcloud/datastore/
    gcloud/datastore/_generated/_entity.proto:    // In JSON requests, must be base64-encoded.
    gcloud/datastore/connection.py:            raise make_exception(headers, error_status.message, use_json=False)

    Even if we were speaking JSON, the Entity representation would have the key.

  3. tseaver commented on Aug 26, 2016

    @tseaver
    Contributor

    I wonder if the user is talking about the fact that Entity inherits from dict, and accesses the properties via __getitem__, but also has its key as an attribute. That is a deliberate design choice (see that JSON representation in the docs, which also separates the key from the properties.

  4. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  5. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    Contributor

    Hello,
    One of the challenges of maintaining a large open source project is that sometimes, you can bite off more than you can chew. As the lead maintainer of google-cloud-python, I can definitely say that I have let the issues here pile up.

    As part of trying to get things under control (as well as to empower us to provide better customer service in the future), I am declaring a "bankruptcy" of sorts on many of the old issues, especially those likely to have been addressed or made obsolete by more recent updates.

    My goal is to close stale issues whose relevance or solution is no longer immediately evident, and which appear to be of lower importance. I believe in good faith that this is one of those issues, but I am scanning quickly and may occasionally be wrong. If this is an issue of high importance, please comment here and we will reconsider. If this is an issue whose solution is trivial, please consider providing a pull request.

    Thank you!

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 Datastore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions