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

Simplify fetch() and fetch_items() #527

Open
sduenas opened this issue May 13, 2019 · 0 comments · May be fixed by #848
Open

Simplify fetch() and fetch_items() #527

sduenas opened this issue May 13, 2019 · 0 comments · May be fixed by #848

Comments

@sduenas
Copy link
Member

sduenas commented May 13, 2019

To retrieve items from a data source, Backend abstract class implements the method fetch. This method creates a generator that will get data calling to fetch_items. By default, this method is not implemented because the logic to fetch data is specific for each data source.

Backends also have to override fetch method to add specific parameters. This method also needs to call to the parent fetch that will all the job. This is a problem because any change in Backend.fetch() needs to be spread around all the classes (e.g move archive from __init__ to fetch).

In my opinion, fetch shouldn't be overiden. The only method backends should implement to add the retrieval logic is fetch_items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant