-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/python sync actions pagination #183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Viz inline comments + je potreba doplnit testy.
@@ -285,6 +293,8 @@ def build_api_request(configuration: dict) -> List[Tuple[ApiRequest, RequestCont | |||
|
|||
placeholders = endpoint_config.get('placeholders', {}) | |||
|
|||
scroller = endpoint_config.get('scroller') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady bych dal rovnou default hodnotu common
at tady nemusis mit tu vyhybku https://github.com/keboola/generic-extractor/pull/183/files#diff-7fff4f60bccf22855c889f4a657abdcc0ede1e2a8b08965eb9f62fdfb346cb60R271
|
||
if paginator_params.get("method") == "offset": | ||
if paginator_params.get("firstPageParams", True): | ||
paginator[paginator_params.get("offsetParam", "offset")] = paginator_params.get("offset", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady bych osobne preferoval, kdyby si ty jednotlivy metody abstrahoval do trid v Configuration
nez davat ten kontext o tom jaky parametry to ma mit do component.py sem. Tj kazdej druh pagination by mel svoji classu
|
||
return result | ||
|
||
def _get_paginator(self, job): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tehle metody chybi return type a jmeno je dost zavadejici. Neni to paginator ale pagination parametry, ale chapu ze to je priprava/zbytek snahy mit opravdovy paginator. Taky chybi typehint u parametru funkce
else: | ||
paginator_params = job.api.pagination.get("common") | ||
|
||
if paginator_params.get("method") == "offset": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes implemented here: #186 |
pagination