etlt.condition.OrCondition.AndCondition.match()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 5
nop 2
dl 0
loc 11
ccs 0
cts 4
cp 0
crap 12
rs 10
c 0
b 0
f 0
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 one or more child conditions match the row.
9
    """
10
11
    # ------------------------------------------------------------------------------------------------------------------
12
    def match(self, row: Dict[str, Any]) -> bool:
13
        """
14
        Returns True if the row matches one or more child conditions. Returns False otherwise.
15
16
        :param dict row: The row.
17
        """
18
        for condition in self._conditions:
19
            if condition.match(row):
20
                return True
21
22
        return False
23
24
# ----------------------------------------------------------------------------------------------------------------------
25