-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #533: add key and entity equality methods #615
Fix #533: add key and entity equality methods #615
Conversation
Move '_dataset_ids_equal' from 'helpers' -> 'key', because it is only useful for keys, and we don't want the cycle.
Closes #533.
Note that this PR assumes my "incomplete keys never compare equal" simplification. |
I like the simplification. Reviewing now. |
:returns: True if the entities compare equal, else False. | ||
""" | ||
if not isinstance(other, Entity): | ||
raise NotImplementedError |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Overall looks good, pending my comments. |
Fix #533: add key and entity equality methods
Utilizing changes in googleapis#615.
Add
Key.{__eq__,__ne__,__hash__}
, including correct handling of prefixed dataset IDs.Move
helpers._dataset_ids_equal
->key
, for better separation of concerns (and to avoid a cycle).Add
Entity.{__eq__,__ne__}
.Fixes #533