Skip to content

Commit

Permalink
Upgrade Artie Transfer (#402)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Villaescusa <[email protected]>
  • Loading branch information
Tang8330 and nathan-artie authored May 29, 2024
1 parent c810814 commit 9b4d39a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22

require (
github.com/DataDog/datadog-go/v5 v5.5.0
github.com/artie-labs/transfer v1.25.15
github.com/artie-labs/transfer v1.25.17
github.com/aws/aws-sdk-go v1.44.327
github.com/aws/aws-sdk-go-v2 v1.18.1
github.com/aws/aws-sdk-go-v2/config v1.18.19
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ github.com/apache/thrift v0.0.0-20181112125854-24918abba929/go.mod h1:cp2SuWMxlE
github.com/apache/thrift v0.14.2/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY=
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/artie-labs/transfer v1.25.15 h1:I9WNJ2PgmX27Nx+eNtBXcoObGKVbpCsRHhEO8s8el9I=
github.com/artie-labs/transfer v1.25.15/go.mod h1:fKEYotV5TFy+uCaE+u/HtPe7ZJE+/8DNUxjgjUYR5HI=
github.com/artie-labs/transfer v1.25.17 h1:GVBW0MRaBcb/ZrZ2g5YFyONswCRwqvsVeoXUkh3wgnY=
github.com/artie-labs/transfer v1.25.17/go.mod h1:Xmco2EaaBcA4Lx+7fYZ5WgmbwZiPF3VewOSaMxDsb8g=
github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.44.327 h1:ZS8oO4+7MOBLhkdwIhgtVeDzCeWOlTfKJS7EgggbIEY=
github.com/aws/aws-sdk-go v1.44.327/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
Expand Down
7 changes: 4 additions & 3 deletions lib/mssql/schema/schema_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package schema

import (
"testing"

"github.com/artie-labs/transfer/lib/ptr"
"github.com/stretchr/testify/assert"
"testing"
)

func TestParseColumnDataType(t *testing.T) {
Expand Down Expand Up @@ -215,7 +216,7 @@ func TestBuildPkValuesQuery(t *testing.T) {
"table",
false,
)
assert.Equal(t, `SELECT TOP 1 "a","b","c" FROM schema."table" ORDER BY "a","b","c"`, query)
assert.Equal(t, `SELECT TOP 1 "a","b","c" FROM "schema"."table" ORDER BY "a","b","c"`, query)
}
{
// Descending
Expand All @@ -229,6 +230,6 @@ func TestBuildPkValuesQuery(t *testing.T) {
"table",
true,
)
assert.Equal(t, `SELECT TOP 1 "a","b","c" FROM schema."table" ORDER BY "a" DESC,"b" DESC,"c" DESC`, query)
assert.Equal(t, `SELECT TOP 1 "a","b","c" FROM "schema"."table" ORDER BY "a" DESC,"b" DESC,"c" DESC`, query)
}
}
8 changes: 4 additions & 4 deletions sources/mongo/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestParseMessage(t *testing.T) {
"_id": objId,
"string": "Hello, world!",
"int32": int32(42),
"int64": int64(1234567890),
"int64": int64(3_000_000_000),
"double": 3.14159,
"decimal": decimal,
"subDocument": bson.M{
Expand Down Expand Up @@ -82,10 +82,10 @@ func TestParseMessage(t *testing.T) {
expectedMap := map[string]any{
"_id": "507f1f77bcf86cd799439011",
"string": "Hello, world!",
"int32": float64(42),
"int64": float64(1234567890), // JSON doesn't know ints vs floats.
"int32": int32(42),
"int64": int64(3000000000),
"double": 3.14159,
"decimal": 1234.5,
"decimal": "1234.5",
"subDocument": `{"nestedString":"Nested value"}`,
"array": []any{"apple", "banana", "cherry"},
"datetime": "2024-02-13T20:37:48+00:00",
Expand Down
2 changes: 1 addition & 1 deletion writers/transfer/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestWriter_MessageToEvent(t *testing.T) {
"__artie_delete": false,
"_id": "507f1f77bcf86cd799439011",
"double": 3.14159,
"int64": 1.23456789e+09,
"int64": int32(1234567890),
"string": "Hello, world!",
}, evtOut.Data)

Expand Down

0 comments on commit 9b4d39a

Please sign in to comment.