Title: DISCUSSION: Entity still not behaving like a dict · Issue #620 · googleapis/google-cloud-python · GitHub
Open Graph Title: DISCUSSION: Entity still not behaving like a dict · Issue #620 · googleapis/google-cloud-python
X Title: DISCUSSION: Entity still not behaving like a dict · Issue #620 · googleapis/google-cloud-python
Description: Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work. ent1 = Entity(key=key1) ent2 = Entity(key=key2) asser...
Open Graph Description: Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work. ent1 = Entity...
X Description: Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work. ent1 = En...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/620
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DISCUSSION: Entity still not behaving like a dict","articleBody":"Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work. \n\n```\nent1 = Entity(key=key1)\nent2 = Entity(key=key2)\nassert not dict(ent1) == dict(ent2)\n\nent = Entity()\nassert not 'key' in ent\nent['key'] = Key('Kind', 'id')\ndatastore.put(ent)\n\nprops={'prop1': 'value1', 'prop2':'value2'}\nent = Entity(key=key1, **props)\n```\n\nThat said I'm still of the opinion that Entity should not be necessary as a class, using instead `datastore.put(key, dict, **options)` or, Entity should be completely key agnostic making implementation of the above easier. \n","author":{"url":"https://github.com/elibixby","@type":"Person","name":"elibixby"},"datePublished":"2015-02-12T19:42:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":23},"url":"https://github.com/620/google-cloud-python/issues/620"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c20b5c49-b7fe-651d-de7b-f0e596f68109 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA20:3BB6AC:15D89CE:1FD7D4F:6A4E4E58 |
| html-safe-nonce | a8586bef0409cb78780ba2a15629baafdf3a31ff258f17c55abdce802b25ee71 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTIwOjNCQjZBQzoxNUQ4OUNFOjFGRDdENEY6NkE0RTRFNTgiLCJ2aXNpdG9yX2lkIjoiOTAxNTIyMjEzMDg3OTM4NTE3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6553f269201a962283db3b810348ff1235b9fdc0d6d51a91f707e620c0c59b97 |
| hovercard-subject-tag | issue:57509150 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b98c4c5bfbb1d1bfdb1cb12c0ef658444961eacd94bf5a739770d549f331321/googleapis/google-cloud-python/issues/620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b98c4c5bfbb1d1bfdb1cb12c0ef658444961eacd94bf5a739770d549f331321/googleapis/google-cloud-python/issues/620 |
| og:image:alt | Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work. ent1 = Entity... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elibixby |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e8506f6d0538364886e3f0153c154c410965e70d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width