https://linen.dev logo
#singer-tap-development
Title
# singer-tap-development
z

zlatan

05/09/2023, 2:46 PM
Hey guys, new to singer tap development here. I just configured custom rest tap and postgress target, and everything is working correctly. I’m just having difficulties with state. In my REST api, there is a field called fromDate, and I can query records from the given date. I defined that date in my streams.py file:
replication_key = "purchaseDate"
That state is saved correctly, and I have the correct value there: state.json file:
{
"bookmarks": {
"purchases": {
"replication_key": "purchaseDate",
"replication_key_value": "2023-05-09T13:34:20.000Z"
}
}
}
The question is now, how can I use
replication_key_value
and send it as query param to my rest in here:
params: dict = {}
if next_page_token:
params["page"] = next_page_token
if self.replication_key:
params["fromDate"] = # get replication_key_value
return params