diff --git a/src/evidently/features/generated_features.py b/src/evidently/features/generated_features.py index b9c570f5d9..68350f3cf7 100644 --- a/src/evidently/features/generated_features.py +++ b/src/evidently/features/generated_features.py @@ -71,7 +71,7 @@ def as_column(self, subcolumn: Optional[str] = None) -> "ColumnName": f"Please specify subcolumn for {self.__class__.__name__} feature, possible values: " + ", ".join(self._extract_subcolumn_name(c.name) for c in columns) ) - if len(columns) == 1 and subcolumn is not None: + if len(columns) == 1 and subcolumn is not None and self._create_column_name(subcolumn) != columns[0].name: raise ValueError(f"{self.__class__.__name__} feature do not have subcolumns") try: fullname = self._create_column_name(subcolumn)