Skip to content

Commit

Permalink
Java CDK: Staging destinations include timezone in extracted_at in CS…
Browse files Browse the repository at this point in the history
…V file (#35313)

Co-authored-by: Gireesh Sreepathi <[email protected]>
  • Loading branch information
edgao and gisripa authored Mar 1, 2024
1 parent 4efc065 commit 1685b27
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion airbyte-cdk/java/airbyte-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ MavenLocal debugging steps:

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.23.10 | 2024-03-01 | [\#35303](https://github.com/airbytehq/airbyte/pull/35303) | various improvements for tests TestDataHolder |
| 0.23.11 | 2024-03-01 | [\#35313](https://github.com/airbytehq/airbyte/pull/35313) | Preserve timezone offset in CSV writer for destinations |
| 0.23.10 | 2024-03-01 | [\#35303](https://github.com/airbytehq/airbyte/pull/35303) | Migration framework with DestinationState for softReset |
| 0.23.9 | 2024-03-01 | [\#35720](https://github.com/airbytehq/airbyte/pull/35720) | various improvements for tests TestDataHolder |
| 0.23.8 | 2024-02-28 | [\#35529](https://github.com/airbytehq/airbyte/pull/35529) | Refactor on state iterators |
| 0.23.7 | 2024-02-28 | [\#35376](https://github.com/airbytehq/airbyte/pull/35376) | Extract typereduper migrations to separte method |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.23.10
version=0.23.11
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.airbyte.cdk.integrations.base.JavaBaseConstants;
import io.airbyte.commons.json.Jsons;
import io.airbyte.protocol.models.v0.AirbyteRecordMessage;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.Collections;
import java.util.LinkedList;
Expand Down Expand Up @@ -62,14 +61,14 @@ public List<Object> getDataRow(final UUID id, final String formattedString, fina
if (useDestinationsV2Columns) {
return List.of(
id,
Timestamp.from(Instant.ofEpochMilli(emittedAt)),
Instant.ofEpochMilli(emittedAt),
"",
formattedString);
} else {
return List.of(
id,
formattedString,
Timestamp.from(Instant.ofEpochMilli(emittedAt)));
Instant.ofEpochMilli(emittedAt));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,10 @@ public void writesContentsCorrectly_when_stagingDatabaseConfig() throws IOExcept
// carriage returns are required b/c RFC4180 requires it :(
// Dynamically generate the timestamp because we generate in local time.
assertEquals(
String.format(
"""
f6767f7d-ce1e-45cc-92db-2ad3dfdd088e,"{""foo"":73}",%s\r
2b95a13f-d54f-4370-a712-1c7bf2716190,"{""bar"":84}",%s\r
""",
Timestamp.from(Instant.ofEpochMilli(1234)),
Timestamp.from(Instant.ofEpochMilli(2345))),
"""
f6767f7d-ce1e-45cc-92db-2ad3dfdd088e,"{""foo"":73}",1970-01-01T00:00:01.234Z\r
2b95a13f-d54f-4370-a712-1c7bf2716190,"{""bar"":84}",1970-01-01T00:00:02.345Z\r
""",
outputStreams.get(0).toString(StandardCharsets.UTF_8));
}

Expand Down

0 comments on commit 1685b27

Please sign in to comment.