Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | from etlt.condition.CompoundCondition import CompoundCondition |
||
2 | |||
3 | |||
4 | class AndCondition(CompoundCondition): |
||
5 | """ |
||
6 | A condition or filter that match (i.e return True) if all child conditions match the row. |
||
7 | """ |
||
8 | |||
9 | # ------------------------------------------------------------------------------------------------------------------ |
||
10 | def match(self, row): |
||
11 | """ |
||
12 | Returns True if the row matches all child conditions. Returns False otherwise. |
||
13 | |||
14 | :param dict row: The row. |
||
15 | |||
16 | :rtype: bool |
||
17 | """ |
||
18 | for condition in self._conditions: |
||
19 | if not condition.match(row): |
||
20 | return False |
||
21 | |||
22 | return True |
||
23 | |||
25 |