etlt.condition.AndCondition   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 23
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A AndCondition.match() 0 11 3
1
from typing import Any, Dict
2
3
from etlt.condition.CompoundCondition import CompoundCondition
4
5
6
class AndCondition(CompoundCondition):
7
    """
8
    A condition or filter that match (i.e. return True) if all child conditions match the row.
9
    """
10
11
    # ------------------------------------------------------------------------------------------------------------------
12
    def match(self, row: Dict[str, Any]) -> bool:
13
        """
14
        Returns whether a row matches all child conditions.
15
16
        :param row: The row.
17
        """
18
        for condition in self._conditions:
19
            if not condition.match(row):
20
                return False
21
22
        return True
23
24
# ----------------------------------------------------------------------------------------------------------------------
25