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 — DISCUSSION: Implement Key.__eq__ and Entity.__eq__ · Issue #533 · googleapis/google-cloud-python

DISCUSSION: Implement Key.__eq__ and Entity.__eq__ #533

New issue
Copy link
New issue
Copy link
Closed
#615
Closed
DISCUSSION: Implement Key.__eq__ and Entity.__eq__#533
#615
Copy link
Assignees
tseaver
Labels
api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Description

@dhermes
dhermes
opened on Jan 12, 2015
Issue body actions

Currently comparison must be done in an ad-hoc way:

assert dict(arya_entity.items()) == {'name': 'Arya', 'family': 'Stark'})

FWIW __eq__ is not something that should really be needed outside of the Key, and even then not so much.

NOTE: This was a small part of #336

Activity

  1. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    on Jan 12, 2015
  2. dhermes commented on Jan 12, 2015

    @dhermes
    dhermes
    on Jan 12, 2015
    ContributorAuthor
    More actions

    FWIW I have implemented Key.__eq__ in https://github.com/dhermes/gcloud-python/tree/key-comparison but it greatly depends on the conversation in #528

  3. tseaver commented on Jan 12, 2015

    @tseaver
    tseaver
    on Jan 12, 2015
    Contributor
    More actions

    Can we simplify by saying that incomplete keys never compare equal to anything? We shoudn't expect them to be super long-lived anyway, and the use-cases seem strongly biased toward "real" equivalence.

    Note that we need to implement __hash__ as well for many sensible uses of __eq__.

  4. jgeewax
    added this to the This milestone has been deleted milestone on Jan 30, 2015
  5. jgeewax
    added
    type: questionRequest for information or clarification. Not an issue.
    on Feb 3, 2015
  6. jgeewax commented on Feb 3, 2015

    @jgeewax
    jgeewax
    on Feb 3, 2015
    Contributor
    More actions

    Just had a chat with @dhermes about "what does equality mean?". The current thinking is:

    • Equal key path
    • Equal entity data (dictionary equivalence)
    • Equal dataset_id (if dataset_id.startswith(s~ or e~): dataset_id = dataset_id[2:])

    If people just want to compare the entity data, they can do a dict(entity) ==
    If people just want to compare the key path, they can do a key.path ==

  7. tseaver
    closed this as completedin #615on Feb 12, 2015
  8. tseaver
    added a commit that references this issue on Feb 12, 2015

    Merge pull request #615 from tseaver/533-key_and_entity_equality

    This issue will close once commit 9a918cf is merged into the 'main' branch.
    9a918cf
  9. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  10. parthea
    added a commit that references this issue on Jul 6, 2023

    Add sentiment analysis sample [(#533)](GoogleCloudPlatform/python-doc…

    d03724a
  11. parthea
    added a commit that references this issue on Aug 15, 2023

    chore: Update gapic-generator-python to v1.11.2 (#533)

    2a11ebf
  12. vchudnov-g
    added a commit that references this issue on Sep 20, 2023

    feat: provide new parameter cx_current_page, the unique identifier of…

    f817bdf
  13. parthea
    added 3 commits that reference this issue on Oct 21, 2023

    chore(main): release 3.17.0 (#533)

    37413f7

    chore(python): upgrade gcp-releasetool in .kokoro [autoapprove] (#533)

    3d18803

    build(deps): [autoapprove] bump certifi from 2022.12.7 to 2023.7.22 (#…

    8ea19f1
  14. parthea
    added a commit that references this issue on Sep 18, 2025

    chore: add prerelease nox session (#533)

    ab48d91
  15. parthea
    added 7 commits that reference this issue on Nov 22, 2025

    fix: Ensure message fields are copied when building retry request (#533)

    0522055

    chore: release 0.28.1 (#533)

    f274d49

    chore: [autoapprove] bump cryptography from 41.0.3 to 41.0.4 (#533)

    31ddf37

    chore: addressed lint issue with __version__ (#534)

    a18b3db

    chore(deps): update google-github-actions/setup-gcloud action to v0.5…

    4ff5e04

    chore: release 1.5.2 (#533)

    67c140c

    chore: release 1.17.2 (#533)

    40b3ade
  16. parthea
    added 4 commits that reference this issue on Mar 6, 2026

    chore: release 2.10.0 (#533)

    797bf39

    refactor: update parse functions, add unit tests (#533)

    0a0b9c1

    docs: add sample for read-only transactions (#533)

    dde21aa

    chore: drop use of 'pytz' in tests / examples (#534)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

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.