Skip to content

Simplify fetch() and fetch_items() #527

@sduenas

Description

@sduenas

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions