Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
DE-1998 Tap-wrike-sdk - Add next page token and remove page limit (#12)
Browse files Browse the repository at this point in the history
* Next page token applied

* Changed formatting

* Added timelgos
  • Loading branch information
SBurwash authored Aug 18, 2023
1 parent e2c0397 commit aff7b74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ plugins:
kind: password
- name: start_date
value: "2010-01-01T00:00:00Z"
select:
- tasks.*
- timelogs.*
loaders:
- name: target-jsonl
variant: andyh1203
Expand Down
7 changes: 2 additions & 5 deletions tap_wrike_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def url_base(self) -> str:
return self.config["api_url"]

records_jsonpath = "$[*]" # Or override `parse_response`.
next_page_token_jsonpath = "$.next_page" # Or override `get_next_page_token`.
next_page_token_jsonpath = "$.nextPageToken" # Or override `get_next_page_token`.

@cached_property
def authenticator(self) -> _Auth:
Expand Down Expand Up @@ -110,10 +110,7 @@ def get_url_params(
"""
params: dict = {}
if next_page_token:
params["page"] = next_page_token
if self.replication_key:
params["sort"] = "asc"
params["order_by"] = self.replication_key
params["nextPageToken"] = next_page_token
return params

def prepare_request_payload(
Expand Down
6 changes: 3 additions & 3 deletions tap_wrike_sdk/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pathlib import Path

from singer_sdk import typing as th # JSON Schema typing helpers
from typing import Any, Dict, Optional

from tap_wrike_sdk.client import wrikeStream

Expand All @@ -26,7 +26,7 @@ class TimelogsStream(wrikeStream):
def get_url_params(
self, context: Optional[dict], next_page_token: Optional[Any]
) -> Dict[str, Any]:
params: dict = {}
params = super().get_url_params(context, next_page_token)
params["fields"] = '[\"billingType\"]'
return params

Expand All @@ -42,7 +42,7 @@ class TasksStream(wrikeStream):
def get_url_params(
self, context: Optional[dict], next_page_token: Optional[Any]
) -> Dict[str, Any]:
params: dict = {}
params = super().get_url_params(context, next_page_token)
params["fields"] = "[\"authorIds\",\"hasAttachments\",\"attachmentCount\",\"parentIds\",\"superParentIds\",\"sharedIds\",\"responsibleIds\",\"responsiblePlaceholderIds\",\"description\",\"briefDescription\",\"recurrent\",\"superTaskIds\",\"subTaskIds\",\"dependencyIds\",\"metadata\",\"customFields\",\"effortAllocation\",\"billingType\"]"
params["pageSize"] = 1000
return params

0 comments on commit aff7b74

Please sign in to comment.