Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datastore): Allow saving nested byte slice #8540

Merged
merged 6 commits into from
Sep 18, 2023

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Sep 10, 2023

Issue: Saving nested byte slice through Datastore Go client libary throws error flattening nested structs leads to a slice of slices
Cause: Datastore does not allow saving entities with nested lists and throws error: rpc error: code = InvalidArgument desc = list_value cannot contain a Value containing another list_value.

To avoid this, the Datastore client library has a validation to prevent slice of slices. But it does not check the datatype of elements in the slice. This is incorrect since Datastore service allows saving nested list of bytes (In Go, byte is an alias for Uint8 ) . So, the library should allow such lists as well.

Fix: Correct the validation condition

@bhshkh bhshkh requested review from a team as code owners September 10, 2023 03:12
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: datastore Issues related to the Datastore API. labels Sep 10, 2023
@bhshkh bhshkh requested a review from enocom September 10, 2023 03:16
@bhshkh bhshkh enabled auto-merge (squash) September 10, 2023 03:17
@bhshkh bhshkh linked an issue Sep 18, 2023 that may be closed by this pull request
@bhshkh bhshkh merged commit 8e53787 into googleapis:main Sep 18, 2023
9 checks passed
@bhshkh bhshkh deleted the fix/issue-7173 branch September 18, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datastore: validateChildType incorrect for flattened []byte slices?
3 participants