Skip to content

Commit

Permalink
Merge pull request #2 from leukeleu/fix-missing-start-date
Browse files Browse the repository at this point in the history
Omit replicationKeyValue param if there's no starting_timestamp
  • Loading branch information
wadevries authored Sep 13, 2023
2 parents ca9bc9b + 7910ecb commit 907e5c7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tap_linear/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

from datetime import timedelta
from typing import Any

from singer_sdk.authenticators import APIKeyAuthenticator
Expand Down Expand Up @@ -53,8 +52,10 @@ def get_url_params(
Returns:
A dictionary of URL params.
"""
next_second = self.get_starting_timestamp(context) + timedelta(seconds=1)
return {
"next": next_page_token,
"replicationKeyValue": next_second.strftime("%Y-%m-%dT%H:%M:%SZ"),
}
params = {"next": next_page_token}

if starting_timestamp := self.get_starting_timestamp(context):
replication_key_value = starting_timestamp.strftime("%Y-%m-%dT%H:%M:%SZ")
params["replicationKeyValue"] = replication_key_value

return params

0 comments on commit 907e5c7

Please sign in to comment.