<#2998 bug: JSONified replication value comparison...
# meltano-repo-activity
g
#2998 bug: JSONified replication value comparison swallows microseconds from datetime objects Issue created by edgarrmondragon ### Singer SDK Version 0.45.10 ### Is this a regression? • Yes ### Python Version NA ### Bug scope Taps (catalog, state, etc.) ### Operating System NA ### Description
Having an issue with bookmark comparison on a sql tap/target.
```
singer_sdk.exceptions.InvalidStreamSortException: Unsorted data detected in stream. Latest value '2025-04-16T115435.060000+00:00' is smaller than previous max '2025-04-16T115435.063000+00:00
```
It looks like an issue on the constraint or the stream sorter that doesn't honor microseconds in the mssql datetime datatype.
This is happening in sdk/singer_sdk/helpers/_typing.py Lines 45 to 47 in</meltano/sdk/commit/dc7fd0d139dbdefbc291772d777d6d3e3c8b941b|dc7fd0d> | if isinstance(val, (datetime.datetime,)): | | ------------------------------------------------------------------------------ | | # Make naive datetimes UTC | | return (val.replace(tzinfo=UTC) if val.tzinfo is None else val).isoformat("T") | ## Links • https://meltano.slack.com/archives/C069CQNHDNF/p1745360849599039 • https://discuss.meltano.com/t/27567128/having-an-issue-with-bookmark-comparison-on-a-sql-tap-target#460ed3cf-fe9d-458d-a905-342ba87abb80 ### Link to Slack/Linen No response meltano/sdk