From 8629f1131af01c9b8d727fb14e7fc85f0b718b28 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Wed, 24 Jul 2024 16:13:06 -0700 Subject: [PATCH] Aligning. --- integration_tests/postgres/main.go | 2 +- sources/postgres/adapter/adapter_test.go | 2 +- sources/postgres/adapter/converters.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/integration_tests/postgres/main.go b/integration_tests/postgres/main.go index 048d10c8..862b337a 100644 --- a/integration_tests/postgres/main.go +++ b/integration_tests/postgres/main.go @@ -693,7 +693,7 @@ const expectedPayloadTemplate = `{ "c_serial": 1000000123, "c_smallint": 32767, "c_text": "QWERTYUIOP", - "c_time_with_timezone": "10:34:17.746572", + "c_time_with_timezone": "10:34:17.746572Z", "c_time_without_timezone": 45296000, "c_timestamp_with_timezone": "2001-02-16T13:38:40Z", "c_timestamp_without_timezone": 982355920000000, diff --git a/sources/postgres/adapter/adapter_test.go b/sources/postgres/adapter/adapter_test.go index 1b2b4e70..80e5071c 100644 --- a/sources/postgres/adapter/adapter_test.go +++ b/sources/postgres/adapter/adapter_test.go @@ -208,7 +208,7 @@ func TestValueConverterForType_Convert(t *testing.T) { name: "time with time zone (postgres.Date)", col: schema.Column{Name: "t_w_tz", Type: schema.TimeWithTimeZone}, value: "12:00:00.123456+07", - expectedValue: "05:00:00.123456", + expectedValue: "05:00:00.123456Z", }, { name: "numeric (postgres.Numeric)", diff --git a/sources/postgres/adapter/converters.go b/sources/postgres/adapter/converters.go index 36a0914e..ea1029e4 100644 --- a/sources/postgres/adapter/converters.go +++ b/sources/postgres/adapter/converters.go @@ -7,7 +7,6 @@ import ( "github.com/artie-labs/reader/lib/timeutil" "github.com/artie-labs/transfer/lib/debezium" - "github.com/artie-labs/transfer/lib/typing/ext" "github.com/jackc/pgx/v5/pgtype" ) @@ -41,7 +40,7 @@ func (TimeWithTimezoneConverter) Convert(value any) (any, error) { // Convert `time.Time` into GMT // Then convert back into a string with ns precision - return timeValue.UTC().Format(ext.PostgresTimeFormatNoTZ), nil + return timeValue.UTC().Format("15:04:05.000000Z"), nil } type PgTimeConverter struct{}