Title: Datastore Query with Key filter failing on GCE · Issue #1639 · googleapis/google-cloud-python · GitHub
Open Graph Title: Datastore Query with Key filter failing on GCE · Issue #1639 · googleapis/google-cloud-python
X Title: Datastore Query with Key filter failing on GCE · Issue #1639 · googleapis/google-cloud-python
Description: Since I upgraded to 0.11.0, I'm seeing a problem with my production environment on GCE, but not when I run it locally. I am trying to query the datastore, using a filter on a property that is a Key. I have example code below - the basic ...
Open Graph Description: Since I upgraded to 0.11.0, I'm seeing a problem with my production environment on GCE, but not when I run it locally. I am trying to query the datastore, using a filter on a property that is a Key...
X Description: Since I upgraded to 0.11.0, I'm seeing a problem with my production environment on GCE, but not when I run it locally. I am trying to query the datastore, using a filter on a property that is a...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/1639
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Datastore Query with Key filter failing on GCE","articleBody":"Since I upgraded to 0.11.0, I'm seeing a problem with my production environment on GCE, but not when I run it locally.\n\nI am trying to query the datastore, using a filter on a property that is a Key. I have example code below - the basic problem is that when using the filter, I get no results back, even when querying using a key I know exists.\n\nLooking at the print statements, the difference between my local and GCE environments appears to be that the key I create myself has `project=project_id` whereas the query returns a key with `project=s~project_id`.\n\nEnvironment: GCE, Python 2.7.9, gcloud 0.11.0 [following code asserts with no results returned from 2nd query]\nLocal: Mac OS X, Python 2.7.10, gcloud 0.11.0 [following code works]\n\n```\nfrom gcloud import datastore\n\ndef main():\n client = datastore.Client()\n\n last_result = None\n query = client.query(kind='Foo')\n results = query.fetch(1)\n for result in results:\n last_result = result\n assert last_result is not None\n\n query2 = client.query(kind='Foo')\n key = client.key('Bar', last_result['bar'].id)\n print key\n print last_result['bar']\n query2.add_filter('bar', '=', key)\n results = query2.fetch(1)\n assert len(list(results)) \u003e 0\n\nif __name__ == '__main__':\n main()\n```\n","author":{"url":"https://github.com/ndenny","@type":"Person","name":"ndenny"},"datePublished":"2016-03-18T23:31:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/1639/google-cloud-python/issues/1639"}
| 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:2180e5fa-9596-35ca-6c29-3c45e1a663b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EA4:A3B49:994199:D17C6E:6A4D4C1D |
| html-safe-nonce | 81e69318208f11afa860c1be90835cb44b6050adb61d005ca5547207047544f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUE0OkEzQjQ5Ojk5NDE5OTpEMTdDNkU6NkE0RDRDMUQiLCJ2aXNpdG9yX2lkIjoiMzY3MjIzNzgxMTk4Nzk5MTU4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8a5869fa5c575947448ded453b005e21e0ce62b1d179e77361e4115fb6f1b458 |
| hovercard-subject-tag | issue:142002057 |
| 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/1639/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b400b4442200a4d665beb30700a555a9c7d10e16e2866f56c885c857b20d389/googleapis/google-cloud-python/issues/1639 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b400b4442200a4d665beb30700a555a9c7d10e16e2866f56c885c857b20d389/googleapis/google-cloud-python/issues/1639 |
| og:image:alt | Since I upgraded to 0.11.0, I'm seeing a problem with my production environment on GCE, but not when I run it locally. I am trying to query the datastore, using a filter on a property that is a Key... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ndenny |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width