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

Support for Multiple URLs by APIDataSet #364

Closed
Minyus opened this issue May 10, 2020 · 1 comment
Closed

Support for Multiple URLs by APIDataSet #364

Minyus opened this issue May 10, 2020 · 1 comment
Labels
Issue: Feature Request New feature or improvement to existing feature

Comments

@Minyus
Copy link
Contributor

Minyus commented May 10, 2020

Description

The provided APIDataSet accepts only a single URL.
I'd like to request support for multiple, potentially a lot of, URLs similar to PartitionedDataSet interface, without being interrupted even if errors occur for some of the URLs.

Context

It is useful to get multiple contents (e.g. json, image, video, model, zip files) through API.
Kedro provides PartitionedDataSet to support multiple datasets in a dict, but cannot be used for this purpose because:

  • It is possible that some of the URLs return errors while the others work fine. An option to skip errors and get contents as many as possible will make sense.

  • It is inefficient to configure a TCP connection for every requests.request call. Instead, requests.Session allows to reuse the same TCP connection to handle multiple requests in less time.

Possible Implementation

  1. Accept a dict of URLs similar to PartitionedDataSet.
  2. Use requests.Session in __init__ method.
  3. Use methods of the requests.Session object to send requests.
  4. Return dict of contents using the same keys as the dict of URLs. For unsuccessful requests, return Exception/response objects without raising.
@Minyus Minyus added the Issue: Feature Request New feature or improvement to existing feature label May 10, 2020
@Minyus
Copy link
Contributor Author

Minyus commented May 19, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request New feature or improvement to existing feature
Projects
None yet
Development

No branches or pull requests

1 participant