Comparison (autotransform.step.condition.comparison)
An enum representing a type of comparison. Used by Conditions to make determinations on the type of check to perform. Includes a compare function those Conditions will use.
- class autotransform.step.condition.comparison.ComparisonType(value)
Bases:
str
,Enum
A list of possible comparisons.
- CONTAINS = 'contains'
- EMPTY = 'empty'
- EQUAL = 'equal'
- GREATER_THAN = 'greater_than'
- GREATER_THAN_OR_EQUAL = 'greater_than_or_equal'
- IN = 'in'
- LESS_THAN = 'less_than'
- LESS_THAN_OR_EQUAL = 'less_than_or_equal'
- NOT_CONTAINS = 'not_contains'
- NOT_EMPTY = 'not_empty'
- NOT_EQUAL = 'not_equal'
- NOT_IN = 'not_in'
- autotransform.step.condition.comparison.compare(first_val: Any, second_val: Any, comparison: ComparisonType) bool
Performs the comparison specified by a ComparisonType.
- Parameters:
first_val (Any) – The first value of the comparison.
second_val (Any) – The second value of the comparison.
comparison (ComparisonType) – The type of comparison to perform.
- Raises:
ValueError – Raised when the comparison is not a valid type.
- Returns:
The results of the comparison.
- Return type:
bool