GitHub
11/11/2024, 6:43 PM>= operation is not supported between a `uuid.UUID`1 instance and a string.
We can fix by simply adding a branch to
sdk/singer_sdk/helpers/_typing.py
Lines 40 to 45 in</meltano/sdk/commit/ae7516b8a16d625c05258570c74e242f1cf64e88|ae7516b>
| def to_json_compatible(val: t.Any) -> t.Any: # noqa: ANN401 |
| -------------------------------------------------------------------------------- |
| """Return as string if datetime. JSON does not support proper datetime types.""" |
| if isinstance(val, (datetime.datetime,)): |
| # Make naive datetimes UTC |
| return (val.replace(tzinfo=UTC) if val.tzinfo is None else val).isoformat("T") |
| return val |
that checks for an instance of uuid.UUID and returns the stringified value. The resulting string-to-string comparison should be safe down to the millisecond.
Note
This may be only be an issue in a very narrow set of use cases, in particular where the experimental sortable UUID Version 72 is enabled via database extensions, such as `pg_uuidv7`3.
Related:
• MeltanoLabs/tap-postgres#519
• #2753
Link to Slack/Linen
No response
Footnotes
1. https://docs.python.org/3/library/uuid.html#uuid.UUID ↩️
2. https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7 ↩️
3. https://github.com/craigpastro/pg_uuidv7 ↩️
meltano/sdkGitHub
11/11/2024, 7:58 PM