Skip to content

Conversation

@pastap
Copy link
Contributor

@pastap pastap commented Dec 3, 2020

Basically creates a generator for users to loop through pages for List<> queries. Implemented on ListSubmissions since that was the ask from clients (and I don't think any other query will exceed 1000 items, tbh)
Atm, only supports going forwards - don't see a need yet to support stuff like "before" and so on

@pastap pastap requested a review from nkassis December 3, 2020 00:05
@pastap pastap requested a review from jkgenser December 3, 2020 15:38
Copy link
Contributor

@jkgenser jkgenser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool

submission_ids = client.call(
WorkflowSubmission(workflow_id=wf.id, files=[dataset_filepath]*5)
)
for sub in client.paginate(ListSubmissions(workflow_ids=[wf.id], limit=3)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we pass a limit of 3 we should get 3 back, if they don't pass this limit we should pass one or use the server default.

elif request and isinstance(request, HTTPRequest):
return self._http.execute_request(request)

def paginate(self, request: PagedRequest):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this function, PageRequest can encapsulate this.

@pastap pastap closed this Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants