Labels Conditions (autotransform.step.condition.labels)
The implementation for Conditions based on labels.
- class autotransform.step.condition.labels.LabelsCondition(*, comparison: ComparisonType, value: str | None = None)
Bases:
ListComparisonCondition[str]A condition which checks the labels for a Change.
- comparison
The type of comparison to perform.
- Type:
- value
The label to check for. Defaults to None.
- Type:
Optional[str], optional
- name
The name of the Component.
- Type:
ClassVar[ConditionName]
- comparison: ComparisonType
- get_val_from_change(change: Change) List[str]
Gets the labels from the Change.
- Parameters:
change (Change) – The Change the Condition is checking.
- Returns:
The labels of the Change.
- Return type:
List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: ClassVar[ConditionName] = 'labels'
- value: str | None