-
Notifications
You must be signed in to change notification settings - Fork 182
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
RESTClient: Extend docstrings of paginator classes #1207
Conversation
✅ Deploy Preview for dlt-hub-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Amazing! The most useful part is a response example like:
with a 'next' key like this:
{"items": [...], "pagination": {"next": "https://api.example.com/items?page=2"}}
.
I would add them for every type of paginators (e.g. HeaderLinkPaginator)
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.
I have one comment regarding next_reference
. I'm not sure if it belongs to base class but if it is we should tell the user when to set it
|
||
Args: | ||
response (Response): The response object from the API. | ||
response (Response): The response object from the API request. |
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.
This method must call next_reference
setter with a value of next reference right? otherwise has_next_page
is not going to work correctly. Maybe we should mention this here?
I also wonder if we really need to force next_referece
in base class and just leave has_next_page
abstract? This property is kind of useful in BaseNextUrlPaginator
(and I wonder why it is public?)
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.
otherwise this is really high quality!
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.
This method must call
next_reference
setter with a value of next reference right? otherwisehas_next_page
is not going to work correctly. Maybe we should mention this here?I also wonder if we really need to force
next_referece
in base class and just leavehas_next_page
abstract? This property is kind of useful inBaseNextUrlPaginator
(and I wonder why it is public?)
Yes, both are valid points:
next_reference
is useless in offset/limit pagination (or page-based), so having it in the base class is not a good design.
Let's address it in a follow-up PR.update_state
needs to modify_has_next_page
indeed. I'll add this to the docstring.
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.
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.
LGTM!
however you need to solve conflict then use your admin power to merge or ask me for another review @burnash
332ac05
to
3fe37ae
Compare
Description
This PR extends class and method docstrings in the paginator classes of the RESTClient module and adds usage examples.
Related Issues