You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Storing embedded entity, it's ignoring exclude_from_indexes from embedded #1206
I'm trying to have a embedded entity with a field that is larger than 1500bytes. I add that field to the exclude_from_indexes key of the embedded entity. When I try and save the parent Entity it tells me the field is bigger than 1500bytes. If I save the embedded entity independently, it works.
Is exclude_from_indexes ignored on embedded entity?
client = datastore.Client(dataset_id=projectID)
record_key = client.key('Record', my_id)
record_entity = datastore.Entity(record_key)
embedded_key = client.key('Data', another_id)
embedded_entity = datastore.Entity(key=embedded_key,exclude_from_indexes=('big_field',))
embedded_entity['field1']='1234'
embedded_entity['big_field']='large string bigger than 1500bytes'
record_entity['RandomFieldName']=embedded_entity
client.put(record_entity)
#Error: gcloud.exceptions.BadRequest: 400 The value of property "big_field" is longer than 1500 bytes.
client.put(embedded_entity)
#No Error
@pcostell I'm not sure what you mean RE: "there is no way" --- see the above. The way is to exclude them on the nested Entity and then we propagate that into the protobuf created. Maybe you mean it would be useful to differentiate between properties in queries?
As for the name used, see the reported snippet at the top of this issue.
Activity
dhermes commentedon Oct 28, 2015
@pcostell What's the expected behavior here?
pcostell commentedon Oct 28, 2015
This should succeed. I am able to get this to work successfully directly from the API (in a commit):
Gives me a 200.
pcostell commentedon Oct 28, 2015
It looks like information about
exclude_from_indexesis not propagated in embedded entities: https://github.com/GoogleCloudPlatform/gcloud-python/blob/c8d231ba7462e2f35d689b526a70cef4712c565a/gcloud/datastore/batch.py#L282dhermes commentedon Oct 28, 2015
Thanks @pcostell!
igama commentedon Oct 29, 2015
@pcostell thanks for debugging this.
Properly handling entity meanings in datastore.
Properly handling entity meanings in datastore.
Properly handling entity meanings in datastore.
dhermes commentedon Dec 21, 2015
@igama This has been fixed:
pcostell commentedon Dec 21, 2015
Note -- This should probably use
.to qualify the name (it matches a proposed field mask design):Otherwise, there is no way to exclude nested field vs non-nested fields.
dhermes commentedon Dec 21, 2015
@pcostell I'm not sure what you mean RE: "there is no way" --- see the above. The way is to exclude them on the nested
Entityand then we propagate that into the protobuf created. Maybe you mean it would be useful to differentiate between properties in queries?As for the name used, see the reported snippet at the top of this issue.
pcostell commentedon Dec 21, 2015
Ah sorry definitely read recorded_entity instead of embedded_entity at embedded creation. Please ignore my comment :-)
dhermes commentedon Dec 21, 2015
No worries. Thanks for taking the time to read the notification
igama commentedon Dec 30, 2015
@dhermes thank you, Will try it in the next days.
feat: add basic interceptor to client (#1206)
fix: fix docstring code block formatting (#1206)
chore: Update CODEOWNERS file to enforce AION SDK team reviews on sha…
feat: add basic interceptor to client (#1206)
chore: librarian release pull request: 20251216T130719Z (#1251)
chore(deps): update dependency google-auth to v2.6.3 (#1206)
chore(deps): update all dependencies (#1206)
docs: migrate code from googleapis/python-bigquery (#18303)