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

feat: support returning and resuming partial results #17

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ShamrockLee
Copy link

Description

Add a parameter keep_failed to Dials.list_all(), specifying whether to return the paginated partial results when an HTTP request fails.

Add a parameter resume_from to Dials.list_all() to accept paginated partial results and resume the fetching.

Add a field exception to PaginatedBaseModel to record the exception that causes the request to fail.

If applied, users would be able to write something like:

data = None
data = dials.h1d.list_all(<filter>, keep_failed=True, resume_from=data)

and resume by UpEnter from the terminal.

TODO

  • Update the documentation.
  • Run the tests.

Add a parameter `keep_failed` to `Dials.list_all()`,
specifying whether to return the paginated partial results
when an HTTP request fails.

Add a parameter `resume_from` to `Dials.list_all()`
to accept paginated partial results and resume the fetching.

Add a field `exception` to `PaginatedBaseModel`
to record the exception that causes the request to fail.

If applied, users would be able to write something like:
```python
data = None
data = dials.h1d.list_all(<filter>, keep_failed=True, resume_from=data)
```
and resume by <Up><Enter> from the terminal.
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.

1 participant