Skip to content

Commit

Permalink
Omit replicationKeyValue param if there's no starting_timestamp
Browse files Browse the repository at this point in the history
This is different from setting replicationKeyValue to None, which would cause GraphQL to actually filter on `updatedAt > null`.
  • Loading branch information
wadevries committed Sep 13, 2023
1 parent a36db9b commit 716a407
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 716a407

Please sign in to comment.