Passed
Pull Request — master (#259)
by Piotr
01:58
created

BasePipeline.run()   A

Complexity

Conditions 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
1
class BasePipeline(object):
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
    steps = None
3
4
    def __init__(self, request, steps=None):
5
        self._request = request
6
        if steps is not None:
7
            self.steps = steps
8
9
    def run(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
10
        assert self.steps is not None, (
11
            'Pipeline `steps` have not been specified. '
12
            'They are required to run the pipeline.'
13
        )
14
15
        context = {'request': self._request}
16
        for step_func in self.steps:
17
            step_context = step_func(**context) or {}
18
            context.update(step_context)
19
20
        return context
21