douwe_maan
03/05/2021, 12:02 AMdouwe_maan
03/05/2021, 12:03 AMdouwe_maan
03/05/2021, 12:06 AMBasicAuthenticator
to prevent taps from having to go through https://github.com/edgarrmondragon/tap-confluence/blob/master/tap_confluence/streams.py#L28-L30 again and again (cc @aaronsteers)douwe_maan
03/05/2021, 12:10 AMresources
setting because catalog-based stream selection hasn't been implemented yet? (Right @aaronsteers? Or is that supported now?)edgar_ramirez_mondragon
03/05/2021, 12:15 AMhttp_headers
. Let me try that!
For request_records
, I wasn't able to make the base class' while
loop work with offset pagination. I was thinking of proposing a pluggable paginator similar to APIAuthenticator
. Header/token-based is relatively common pagination method, but I'd argue offset is even more so.
And yeah, I added resources
mainly just for my own testing purposes syncing only selected streams and I didn't consider doing it the right way with a catalog, but I definitely will.douwe_maan
03/05/2021, 12:19 AMForÂAh, right, because, I wasn't able to make the base class'Ârequest_records
 loop work with offset pagination.while
get_next_page_token
wouldn't have access to your start
... Sounds like we should pass next_page_token
(code) to get_next_page_token
as prev_page_token
. Then you could define it as:
def get_next_page_token(self, response: requests.Response, prev_page_token) -> Any:
data = response.json()
size, limit = data["size"], data["limit"]
if size < limit:
return None
return prev_page_token + limit
And/or we could make it pluggable as you suggest. Sounds like it's time for an issue 🙂douwe_maan
03/05/2021, 12:27 AMedgar_ramirez_mondragon
03/05/2021, 12:29 AMaaronsteers
03/05/2021, 12:29 AMaaronsteers
03/05/2021, 12:32 AMaaronsteers
03/05/2021, 12:34 AMaaronsteers
03/05/2021, 1:31 AMAh, right, becauseÂWow - I think it’s crazy that I was basically implementing exactly this change, perhaps even as you were typing it. 🙂 I didn’t see your comment until after, but we ran into the same challenge in the Power BI tap and came upon that as the best solve. Here is the working implementation we came up with for Power BI REST API. For this, we needed to keep track of our own keys along the way so we could continue to loop through them according to custom app logic: https://github.com/dataops-tk/tap-powerbi-metadata/blob/fix/remove-extra-logic/tap_powerbi_metadata/streams.py#L77 wouldn’t have access to yourÂget_next_page_token
 ... Sounds like we should passÂstart
 (code) toÂnext_page_token
 asÂget_next_page_token
 …prev_page_token
aaronsteers
03/05/2021, 1:32 AMdouwe_maan
03/05/2021, 1:35 AMedgar_ramirez_mondragon
03/05/2021, 1:49 AMdef get_next_page_token(
self,
response: requests.Response,
previous_token: Optional[int],
) -> Optional[int]:
previous_token = previous_token or 1
data = response.json()
size, limit = data["size"], data["limit"]
if size < limit:
return None
return previous_token + limit
aaronsteers
03/05/2021, 4:54 PM0.1.0
, the plan would be have everything in the repo's change log and with associated MRs.