Skip to content
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

Limiting results #20

Open
sckott opened this issue Oct 2, 2015 · 4 comments
Open

Limiting results #20

sckott opened this issue Oct 2, 2015 · 4 comments
Labels
Milestone

Comments

@sckott
Copy link
Collaborator

sckott commented Oct 2, 2015

Noticed something while making fix in #18 - that we probably need to give user power to determine how much data they get back.

Our while loop will just keep going, getting more data if a resumptionToken is available.

We may not be able to expose a parameter that does this exactly, like limit = 10, and you get 10 results, but at least it could be something like

  • limit = "all" (all results)
  • limit = "one" (do one HTTP request, then stop, so even if get a resumptionToken, stop anyway)
  • other options?
@sckott sckott added the question label Oct 2, 2015
@mbojan
Copy link
Member

mbojan commented Oct 2, 2015

Good idea. Definitely worth using when testing other functions... This could be:

  • the maximal number of requests made.
  • the maximal number of records/identifiers fetched (probably does not make sense)

@mbojan
Copy link
Member

mbojan commented Oct 2, 2015

Alternatively:

  • limit = Inf (default): get all
  • limit >= 1: make limit requests
  • limit < 1: error

@sckott
Copy link
Collaborator Author

sckott commented Oct 2, 2015

Right, the confusing part about using integers though is that the user may be thinking if they set limit = 10, they'll get 10 records/identifiers/etc., but in reality, 10 http requests are made (if that many required), with probably 50 results X 10 requests = 500 results. I guess we can just make clear in docs.

Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.

@mbojan
Copy link
Member

mbojan commented Oct 2, 2015

I think it may be clarified in the docs. We can also call the argument max_requests.

Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.

Actually why would anybody be determined to fetch only some small number of records? Limiting number of requests makes sense for testing purposes.

@sckott sckott modified the milestone: v0.2 Oct 5, 2015
@sckott sckott modified the milestones: v0.3, v0.2 Feb 5, 2016
@sckott sckott modified the milestones: v0.3, v0.4 Sep 6, 2019
@mbojan mbojan modified the milestones: v0.4, v0.5 Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants