-
Notifications
You must be signed in to change notification settings - Fork 654
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
DynamoDB expression.NameBuilder.Contains() forces input to string, but interface{} should be supported #2322
Comments
Local branch changes with all tests passing within expression directory Screen.Recording.2023-10-18.at.11.34.08.AM.mov |
@andrewcretin It's difficult to assess the scope of your changes through this issue and the linked videos. Would you be able to open a PR? |
@lucix-aws I certainly can. I would need to be given contributor access first, but can get that done this morning. It's a very minor change |
@andrewcretin That's not actually required -- you can fork the repository, commit your changes to a branch in that fork, and then create a PR to merge changes in your branch into our |
On it 🫡 |
@lucix-aws PR here: #2324 |
|
Describe the bug
The NameBuilder.Contains() does not allow for filtering sets of types other than strings. For example, a Set of Number []int{1,2,3} can not be filtered using Contains as the value must be cast to a string.
Expected Behavior
I should be able to provide a value of any type, represented by an interface and contains should work so long as the provided value is the same value of the attribute (either primitive or list)
Current Behavior
The contains value is being forced to string (implementation likely done for substring or larger string) but this should also work for searching for a value contained within a list (of any supported type)
Reproduction Steps
See additional info and test case included in possible solution
Possible Solution
In
condition.go
and
In
condition_test.go
Additional Information/Context
Media showing working implementation on my use case. (local changes to library)
Use Case: Filtering objects that have
LocationIds: []int
using contains for value 199. Existing code forces string, which fails. When replaced with interface, the expected values are returnedNOT WORKING
broken.mp4
WORKING
fixed.mp4
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/google/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected]
github.com/aws/aws-sdk-go-v2/feature/dynamodb/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
Compiler and Version used
go version go1.18 darwin/arm64
Operating System and version
Mac OS Sonoma - Version 14.1 Beta (23B5067a)
The text was updated successfully, but these errors were encountered: