From 41b6d582eb4020f9ee5b200689fa68a179f00210 Mon Sep 17 00:00:00 2001 From: Will Donnelly Date: Wed, 13 Nov 2024 17:31:33 -0600 Subject: [PATCH] source-snowflake: Fix out-of-range numeric value Our `TestBasicDatatypes` test included an out-of-range value for a fixed-point numeric column which was previously rounded but now Snowflake just rejects when we try to insert it. I've opted to fix this by simply changing that value to something else that's within the declared range -- it's not our business to validate Snowflake numeric rounding behavior so long as we're processing whatever we get back from them correctly. --- source-snowflake/.snapshots/TestBasicDatatypes-main | 2 +- source-snowflake/capture_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source-snowflake/.snapshots/TestBasicDatatypes-main b/source-snowflake/.snapshots/TestBasicDatatypes-main index ef04af4fff..80b4d0a123 100644 --- a/source-snowflake/.snapshots/TestBasicDatatypes-main +++ b/source-snowflake/.snapshots/TestBasicDatatypes-main @@ -2,7 +2,7 @@ # Collection "acmeCo/test/test_basicdatatypes_77528227": 3 Documents # ================================ {"BDATA":"7loRpQ==","BIT":false,"DATA":"DCBA","FDATA":2.64,"ID":3,"X":0,"Y":0,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":0}}} -{"BDATA":"/w==","BIT":false,"DATA":" ","FDATA":0.00001,"ID":4,"X":-9999,"Y":100,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":1}}} +{"BDATA":"/w==","BIT":false,"DATA":" ","FDATA":0.00001,"ID":4,"X":-9999,"Y":-0.99,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":1}}} {"BDATA":null,"BIT":null,"DATA":null,"FDATA":null,"ID":5,"X":null,"Y":null,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":2}}} # ================================ # Final State Checkpoint diff --git a/source-snowflake/capture_test.go b/source-snowflake/capture_test.go index 10b020ede1..f9df0a1a07 100644 --- a/source-snowflake/capture_test.go +++ b/source-snowflake/capture_test.go @@ -70,7 +70,7 @@ func TestBasicDatatypes(t *testing.T) { tb.Insert(ctx, t, tableName, [][]any{ {3, "DCBA", []byte{0xEE, 0x5A, 0x11, 0xA5}, 2.64, false, 0, 0}, - {4, " ", []byte{0xFF}, 0.00001, false, -9999, 99.999}, + {4, " ", []byte{0xFF}, 0.00001, false, -9999, -0.99}, {5, nil, nil, nil, nil, nil, nil}, }) t.Run("main", func(t *testing.T) { verifiedCapture(ctx, t, cs) })