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

Feat/googleps04 71 support set datatype #5

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

taherkl
Copy link
Collaborator

@taherkl taherkl commented Dec 4, 2024

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to README are included in PR

@taherkl taherkl marked this pull request as ready for review December 5, 2024 04:33
count := 0
for i := 0; i < v.Len(); i++ {
listVal = append(listVal, v.Index(i).String())
count++
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count is not used.

@@ -59,7 +59,7 @@ func RouteRequest(c *gin.Context) {
case "UpdateItem":
Update(c)
default:
c.JSON(errors.New("ValidationException", "Invalid X-Amz-Target header value of" + amzTarget).
c.JSON(errors.New("ValidationException", "Invalid X-Amz-Target header value of"+amzTarget).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space after "of" before concatenating amzTarget

stringMap := make(map[string]struct{})
for _, v := range a.SS {
if _, exists := stringMap[*v]; !exists {
stringMap[*v] = struct{}{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this change only handles deduplication.

@@ -759,133 +758,157 @@ func parseRow(r *spanner.Row, colDDL map[string]string) (map[string]interface{},
}
v, ok := colDDL[k]
if !ok {
fmt.Println(k)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just left over debug logging?

var m interface{}
if err := json.Unmarshal(s, &m); err != nil {
logger.LogError(err, string(s))
row[col] = string(s)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here as you are falling back to raw string.

@@ -404,11 +404,7 @@ func TestChangeMaptoDynamoMap(t *testing.T) {
"age": map[string]interface{}{"N": "20"},
"value": map[string]interface{}{"N": "10"},
"array": map[string]interface{}{
"L": []map[string]interface{}{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now we are mapping array to string set instead of list. This is a change in behavior and may break existing applications just like this test case.

@taherkl taherkl changed the title Feat/googleps04 71 support stringset Feat/googleps04 71 support set datatype Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants