sdk icon indicating copy to clipboard operation
sdk copied to clipboard

fix: `_write_starting_replication_value` for `_sync_batches`

Open ReubenFrankel opened this issue 9 months ago • 4 comments

Singer SDK Version

0.44.3

Is this a regression?

  • [ ] Yes

Python Version

NA

Bug scope

Taps (catalog, state, etc.)

Operating System

Ubuntu 22.04

Description

This is currently present for _sync_records, but not for _sync_batches. This means that given no state, if start_date is set in config and get_starting_timestamp is called from a get_batches implementation, it does not return an initial timestamp for the value of start_date.

Link to Slack/Linen

No response

ReubenFrankel avatar Feb 12 '25 17:02 ReubenFrankel

(sorry, not sure if this is a bug report or feature request)

ReubenFrankel avatar Feb 12 '25 17:02 ReubenFrankel

The workaround is fairly simple:

        if start_date := self.get_starting_timestamp(context) or (
            "start_date" in self.config
            and datetime.fromisoformat(self.config["start_date"])
        ):
            payload["startDateTime"] = start_date.strftime(r"%Y-%m-%d %H:%M:%S")

ReubenFrankel avatar Feb 12 '25 18:02 ReubenFrankel

(sorry, not sure if this is a bug report or feature request)

I would probably consider it a bug.

The workaround is fairly simple:

You mean on the tap implementation side?

edgarrmondragon avatar Feb 13 '25 17:02 edgarrmondragon

You mean on the tap implementation side?

Yep.

ReubenFrankel avatar Feb 13 '25 17:02 ReubenFrankel