grimoirelab-perceval icon indicating copy to clipboard operation
grimoirelab-perceval copied to clipboard

Simplify fetch() and fetch_items()

Open sduenas opened this issue 5 years ago • 0 comments

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.

sduenas avatar May 13 '19 18:05 sduenas