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 — property has list_value and don't want to index will raise exception · Issue #398 · googleapis/google-cloud-python

property has list_value and don't want to index will raise exception #398

New issue
Copy link
New issue
Copy link
Closed
Closed
property has list_value and don't want to index will raise exception#398
Copy link
Assignees
tseaver
Labels
🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

Description

@lucemia
lucemia
opened on Dec 2, 2014
Issue body actions

if a property is list_value and the property name is included in exclude_from_indexes
the following exception will raise.

The protobuf file has describe this behavior

// A list value.
  // Cannot contain another list value.
  // Cannot also have a meaning and indexing set.
  repeated Value list_value = 7;

https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/v1beta2-rev1-2.1.0/proto/datastore_v1.proto#L123

 File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/entity.py", line 244, in save
    exclude_from_indexes=self.exclude_from_indexes())
  File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/connection.py", line 425, in save_entity
    result = self.commit(dataset_id, mutation)
  File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/connection.py", line 329, in commit
    datastore_pb.CommitResponse)
  File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/connection.py", line 81, in _rpc
    data=request_pb.SerializeToString())
  File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/connection.py", line 59, in _request
    raise Exception('Request failed. Error was: %s' % content)
Exception: Request failed. Error was: A Value containing a list_value cannot specify indexed.

An example

entity = Dataset(dataset, kind, exclude_from_indexes=('a',))
entity['a'] = [1,2,3]
entity.save()

Activity

Next
  1. dhermes commented on Dec 2, 2014

    @dhermes
    dhermes
    on Dec 2, 2014
    Contributor
    More actions

    /cc @pcostell

    The error message seems strange since a is excluded. Though maybe it is referring to the property in general.

    Also I'm curious why lists can't be indexed. IIRC a query like

    class Foo(ndb.Model):
        bar = ndb.StringProperty(repeated=True)
    
    q = Foo.query(Foo.bar == 10)

    works just fine.

  2. pcostell commented on Dec 2, 2014

    @pcostell
    pcostell
    on Dec 2, 2014
    Contributor
    More actions

    Unlike Cloud Datastore, the App Engine datastore just uses repeated values as opposed to a list_value. I believe each value of 'a' should specify if it can be indexed or not, for example:

    {  
      key: ...
      data: { 
        list_value {
          value {
            string_value: "hi",
            indexed: False
          },
          value {
             integer_value: 12,
             indexed: False
          }
        }
      }
    }
  3. tseaver commented on Dec 3, 2014

    @tseaver
    tseaver
    on Dec 3, 2014
    Contributor
    More actions

    The protobuf spec says that items in a list_values "[c]annot also have a meaning and indexing set."

  4. pcostell commented on Dec 3, 2014

    @pcostell
    pcostell
    on Dec 3, 2014
    Contributor
    More actions

    I think the spec is actually saying that list_value cannot have a meaning and indexing set. The Value's inside can have indexing set. I'll be sure to tweak the protobuf spec to be more clear.

  5. tseaver commented on Dec 3, 2014

    @tseaver
    tseaver
    on Dec 3, 2014
    Contributor
    More actions

    I bow to your knowledge of the backend. Note that having the items in the list declare their indexing directly seems completely counter-intuitive to me.

  6. dhermes commented on Dec 4, 2014

    @dhermes
    dhermes
    on Dec 4, 2014
    Contributor
    More actions

    @pcostell ISTM we have a choice here to support a set of repeated values or a list_value. In our current implementation, the user doesn't select, we just imply list_value from the type of the value.

    When and where would an end user decide if they wanted to use one or the other?

  7. pcostell commented on Dec 4, 2014

    @pcostell
    pcostell
    on Dec 4, 2014
    Contributor
    More actions

    @dhermes -- In Cloud Datastore list_value is the only option. Putting an entity with the same property multiple times will result in an error.

  8. dhermes commented on Dec 30, 2014

    @dhermes
    dhermes
    on Dec 30, 2014
    Contributor
    More actions

    @tseaver Did #399 fully fix this? ISTM it did, but want to double-check.

  9. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    on Dec 30, 2014
  10. tseaver commented on Dec 31, 2014

    @tseaver
    tseaver
    on Dec 31, 2014
    Contributor
    More actions

    Via #399.

  11. tseaver
    closed this as completedon Dec 31, 2014
  12. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  13. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  14. 11 remaining items

  15. parthea
    added 2 commits that reference this issue on Oct 21, 2023

    fix: Add async context manager return types (#398)

    e882273

    chore(deps): update all dependencies (#398)

    3d5fc3d
  16. parthea
    added 10 commits that reference this issue on Nov 22, 2025

    chore: release 2.3.3 (#398)

    d2c39ad

    Add markupsafe dependency (#398)

    ecee115

    chore(python): conditionally load credentials in .kokoro/build.sh (#398)

    1d8a5a4

    chore(deps): update all dependencies (#398)

    78f04b2

    feat: named database support (#439)

    8eabeca

    fix: hash snapshots using correct type for 'update_time' (#467)

    fb9c0ff

    chore(deps): update dependency google-cloud-storage to v1.42.2 (#398)

    2af2c4b

    fix: clear context cache on rollback (#410)

    fdc9c82

    chore(deps): update dependency google-cloud-storage to v1.42.2 (#398)

    b34f28b

    fix(google.auth.compute_engine.metadata): add retry to google.auth.co…

    56ce0a3
  17. parthea
    added a commit that references this issue on Mar 2, 2026

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

    f0b9f7e
  18. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    chore: release 1.37.0 (#398)

    07ffc68

    chore: release 3.7.0 (#398)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

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.