Skip to content

fix: Add timestamp parsing logic to JSON flattener#19686

Merged
kodiakhq[bot] merged 3 commits intomainfrom
mariano/fix-incorrect-time-parsing-logic
Nov 25, 2024
Merged

fix: Add timestamp parsing logic to JSON flattener#19686
kodiakhq[bot] merged 3 commits intomainfrom
mariano/fix-incorrect-time-parsing-logic

Conversation

@marianogappa
Copy link
Copy Markdown
Contributor

@marianogappa marianogappa commented Nov 25, 2024

fixes https://github.com/cloudquery/cloudquery-issues/issues/2821

The timestamp field parsing logic on the JSON Flattener is just plain wrong: it was assuming that timestamp type subfields would be of type time.Time, and this is not the case.

The TypeSchema reports timestamp types as timestamp[us, tz=UTC], but in practice I've already seen two slightly different date formats.

Therefore, in this change, for timestamp subfields, if the underlying type of the subfield is string, we will try to parse the string datetime using a variety of popular formats, including some reported by our customers and some seen in the AWS plugin in tests.

@marianogappa marianogappa marked this pull request as ready for review November 25, 2024 12:12
@marianogappa marianogappa requested review from a team and maaarcelino November 25, 2024 12:12
@marianogappa marianogappa added automerge Automatically merge once required checks pass area/ci labels Nov 25, 2024
kodiakhq bot pushed a commit that referenced this pull request Nov 25, 2024
#### Summary

Transformer plugins are currently owned by data framework. This should unblock my review to #19686
@erezrokah erezrokah requested review from a team and k-rheinheimer November 25, 2024 14:28
@cq-bot cq-bot removed the area/ci label Nov 25, 2024
@kodiakhq kodiakhq bot merged commit ec27826 into main Nov 25, 2024
@kodiakhq kodiakhq bot deleted the mariano/fix-incorrect-time-parsing-logic branch November 25, 2024 14:43
kodiakhq bot pushed a commit that referenced this pull request Nov 25, 2024
🤖 I have created a release *beep* *boop*
---


## [1.1.0](plugins-transformer-jsonflattener-v1.0.3...plugins-transformer-jsonflattener-v1.1.0) (2024-11-25)


### Features

* Add license information ([#19642](#19642)) ([a81edd6](a81edd6))


### Bug Fixes

* Add timestamp parsing logic to JSON flattener ([#19686](#19686)) ([ec27826](ec27826))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.69.0 ([#19677](#19677)) ([84cd7bd](84cd7bd))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants