Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 0 |
1 | 1 | from typing import Any, Dict |
|
2 | |||
3 | from etlt.condition.SimpleCondition import SimpleCondition |
||
4 | 1 | ||
5 | |||
6 | class PlainCondition(SimpleCondition): |
||
7 | """ |
||
8 | A plain condition matches a field in the row against a plain value. |
||
9 | """ |
||
10 | 1 | ||
11 | # ------------------------------------------------------------------------------------------------------------------ |
||
12 | def match(self, row: Dict[str, Any]) -> bool: |
||
13 | """ |
||
14 | Returns True if the fields equals the expression of this simple condition. Returns False otherwise. |
||
15 | |||
16 | :param row: The row. |
||
17 | """ |
||
18 | return row[self._field] == self._expression |
||
19 | |||
20 | # ------------------------------------------------------------------------------------------------------------------ |
||
21 | 1 | @property |
|
22 | 1 | def scheme(self) -> str: |
|
23 | """ |
||
24 | Returns 'plain'. |
||
25 | """ |
||
26 | return 'plain' |
||
27 | |||
29 |