Title: PreconditionFailed: 412 no matching index found. when using inequality filters · Issue #1143 · googleapis/google-cloud-python · GitHub
Open Graph Title: PreconditionFailed: 412 no matching index found. when using inequality filters · Issue #1143 · googleapis/google-cloud-python
X Title: PreconditionFailed: 412 no matching index found. when using inequality filters · Issue #1143 · googleapis/google-cloud-python
Description: I am using appengine to run my app and gcloud for accessing cloud datastore. I have gcloud model where i am storing username and date_time attribute. but when i am doing this. from gcloud.datastore.query import Query from datetime import...
Open Graph Description: I am using appengine to run my app and gcloud for accessing cloud datastore. I have gcloud model where i am storing username and date_time attribute. but when i am doing this. from gcloud.datastore...
X Description: I am using appengine to run my app and gcloud for accessing cloud datastore. I have gcloud model where i am storing username and date_time attribute. but when i am doing this. from gcloud.datastore...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/1143
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PreconditionFailed: 412 no matching index found. when using inequality filters","articleBody":"I am using appengine to run my app and gcloud for accessing cloud datastore.\nI have gcloud model where i am storing username and date_time attribute.\n\nbut when i am doing this.\n\n``` python\nfrom gcloud.datastore.query import Query\nfrom datetime import datetime\nquery = Query(kind=\"MyTable\")\nquery.add_filter('username', '=', 'somevalue')\nquery.add_filter('date_time', '\u003c', datetime.now())\n\niterator = query.fetch(limit=10)\nrecords, more, cursor = iterator.next_page()\nprint records\n```\n\nI am getting the following exception.\n\n``` log\n File \"/Users/sathyanarrayanan/Desktop/app/services/cdr_helper.py\", line 528, in fetch_last_users\n records, more, cursor = iterator.next_page()\n File \"/Users/sathyanarrayanan/Desktop/app/gcloud/datastore/query.py\", line 388, in next_page\n transaction_id=transaction and transaction.id,\n File \"/Users/sathyanarrayanan/Desktop/app/gcloud/datastore/connection.py\", line 257, in run_query\n datastore_pb.RunQueryResponse)\n File \"/Users/sathyanarrayanan/Desktop/app/gcloud/datastore/connection.py\", line 108, in _rpc\n data=request_pb.SerializeToString())\n File \"/Users/sathyanarrayanan/Desktop/app/gcloud/datastore/connection.py\", line 85, in _request\n raise make_exception(headers, content, use_json=False)\nPreconditionFailed: 412 no matching index found.\n```\n\nBelow is my index file.\n\n``` yaml\n#File index.yaml\n\n- kind: MyTable\n ancestor: yes\n properties:\n - name: date_time\n\n- kind: MyTable\n ancestor: yes\n properties:\n - name: date_time\n direction: desc\n\n- kind: MyTable\n ancestor: yes\n properties:\n - name: username\n direction: asc\n - name: date_time\n direction: desc\n\n- kind: MyTable\n ancestor: yes\n properties:\n - name: username\n direction: asc\n - name: date_time\n```\n\nfor more details: http://stackoverflow.com/questions/32607351/412-no-matching-index-found-while-executing-a-query-in-cloud-datastore\n","author":{"url":"https://github.com/sourcepirate","@type":"Person","name":"sourcepirate"},"datePublished":"2015-09-18T06:26:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1143/google-cloud-python/issues/1143"}
| 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:6b522e5c-3e52-6f02-8bc6-91ad66340d34 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83F0:4D341:4CF228:687E8A:6A4D60D8 |
| html-safe-nonce | 439d1c0749f0bb8c2f5a26746cc70c837531fde43362dc10ee5072435d9b3c5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0YwOjREMzQxOjRDRjIyODo2ODdFOEE6NkE0RDYwRDgiLCJ2aXNpdG9yX2lkIjoiMjAwMDM5MDE0MjQwNTk5MjY2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 91fdc56d802246cf0711983317092d5ec133f7b74bef28e773ceb249adbb3e69 |
| hovercard-subject-tag | issue:107141281 |
| 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/1143/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9c29e586467d545328dd9d4240b9ea93edb6b0aff051f8890936d531943d0cb4/googleapis/google-cloud-python/issues/1143 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c29e586467d545328dd9d4240b9ea93edb6b0aff051f8890936d531943d0cb4/googleapis/google-cloud-python/issues/1143 |
| og:image:alt | I am using appengine to run my app and gcloud for accessing cloud datastore. I have gcloud model where i am storing username and date_time attribute. but when i am doing this. from gcloud.datastore... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sourcepirate |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6658d7c7808aeed776f841e0839b885fce343c9b96244be612c779298e7661e |
| 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 | a438513d3a22ffcd713795ed948c3e5525007665 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width