akurdyukov / tap-clickhouse

Meltano SDK based tap for ClickHouse
Apache License 2.0
0 stars 2 forks source link

Wrong date string serialization in jsonschema #10

Closed gallejesus closed 2 weeks ago

gallejesus commented 7 months ago

Hello,

We are finding an issue when dealing with Date columns due to String serialization.

In Meltano SDK, a Date it being serialized as f"{elem.isoformat()}T00:00:00+00:00" (https://github.com/meltano/sdk/blob/b02d698c15c1fff8667e18e5301c65a0fd0247b5/singer_sdk/helpers/_typing.py#L477-L478) which will always fail afterwards jsonschema validation, as the serialized string does not match jsconschema Date format (https://json-schema.org/understanding-json-schema/reference/string#dates-and-times).

Several taps have already implemented a workaround:

cc: @Plozano94

Plozano94 commented 7 months ago

We are pretty aware that the main issue is in the SDK but we'll appreciate the workaround until they decide to fix it :)

pulsar256 commented 1 month ago

here is another workaround which can be applied in the tap configuration:

(...)
      stream_maps:
        my_stream:
          my_date: _['my_date'][0:10]

Is this a reported issue in the SDK? I skimmed through the open issues and was not able to spot it right away.

pulsar256 commented 1 month ago

Is this a reported issue in the SDK? I skimmed through the open issues and was not able to spot it right away.

https://github.com/meltano/sdk/issues/1831

pulsar256 commented 4 weeks ago

fixed upstream in the SDK https://github.com/meltano/sdk/pull/2580 in and released with 0.39.1 https://github.com/meltano/sdk/releases/tag/v0.39.1

akurdyukov commented 4 weeks ago

Ok, I'll try to update SDK in this project this weekend.

akurdyukov commented 2 weeks ago

Please check and reopen if the problem isn't fixed