Skip to content

Conversation

@NamrataM
Copy link
Member

To enable pagination, I've introduced a flag called paginate to control limiting of result size. If paginate is set to True results should be limited by page size and offset. They would be specified in the url inputted to the function. If paginate is False or is not specified, the function will scan, collect and return all records for the query.

Copy link
Contributor

@DustinKLo DustinKLo left a comment

Choose a reason for hiding this comment

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

LGTM 👍
because HySDS v3 is legacy we'll keep backwards compatibility but v4 will disable the "fetch all" capabilities in get_job_list

...also because hysds_commons.request_utils was removed in v4 so we don't get things like get_scrolled_json_response for free anymore



def post_scrolled_json_responses(url, es_url, generator=False, **kwargs):
def post_scrolled_json_responses(url, es_url, paginate=False, generator=False, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def post_scrolled_json_responses(url, es_url, paginate=False, generator=False, **kwargs):
def post_scrolled_json_responses(url, es_url, generator=False, paginate=False, **kwargs):

@NamrataM: thinking that we should move paginate after the generator kwarg since generator existed before the addition of paginate and end users may be calling the method without specifying generator=<var>.

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