diff --git a/src/zenml/cli/integration.py b/src/zenml/cli/integration.py index 419c618861e..510b0a5cd41 100644 --- a/src/zenml/cli/integration.py +++ b/src/zenml/cli/integration.py @@ -57,7 +57,7 @@ def list_integrations() -> None: warning( "\n" + "To install the dependencies of a specific integration, type: " ) - warning("zenml integration install EXAMPLE_NAME") + warning("zenml integration install INTEGRATION_NAME") @integration.command( @@ -89,7 +89,7 @@ def get_requirements(integration_name: Optional[str] = None) -> None: "\n" + "To install the dependencies of a " "specific integration, type: " ) - warning("zenml integration install EXAMPLE_NAME") + warning("zenml integration install INTEGRATION_NAME") @integration.command( diff --git a/src/zenml/integrations/evidently/__init__.py b/src/zenml/integrations/evidently/__init__.py index bceba2cd303..109b3b2a900 100644 --- a/src/zenml/integrations/evidently/__init__.py +++ b/src/zenml/integrations/evidently/__init__.py @@ -22,13 +22,31 @@ file. """ +import logging +import os +import warnings from typing import List, Type -from zenml.enums import StackComponentType from zenml.integrations.constants import EVIDENTLY from zenml.integrations.integration import Integration from zenml.stack import Flavor + +# Fix numba errors in Docker and suppress logs and deprecation warning spam +try: + from numba.core.errors import ( # type: ignore[import] + NumbaDeprecationWarning, + NumbaPendingDeprecationWarning, + ) + + os.environ["NUMBA_CACHE_DIR"] = "/tmp" # nosec + numba_logger = logging.getLogger("numba") + numba_logger.setLevel(logging.WARNING) + warnings.simplefilter("ignore", category=NumbaDeprecationWarning) + warnings.simplefilter("ignore", category=NumbaPendingDeprecationWarning) +except ImportError: + pass + EVIDENTLY_DATA_VALIDATOR_FLAVOR = "evidently" @@ -36,12 +54,7 @@ class EvidentlyIntegration(Integration): """[Evidently](https://github.com/evidentlyai/evidently) integration for ZenML.""" NAME = EVIDENTLY - REQUIREMENTS = ["evidently>0.2.6,<=0.2.8"] # supports old API and pyyaml 6 - - @staticmethod - def activate() -> None: - """Activate the Evidently integration.""" - from zenml.integrations.evidently import materializers # noqa + REQUIREMENTS = ["evidently>0.2.6"] # supports pyyaml 6 @classmethod def flavors(cls) -> List[Type[Flavor]]: diff --git a/src/zenml/integrations/evidently/data_validators/evidently_data_validator.py b/src/zenml/integrations/evidently/data_validators/evidently_data_validator.py index a2d47146985..3501fa723ab 100644 --- a/src/zenml/integrations/evidently/data_validators/evidently_data_validator.py +++ b/src/zenml/integrations/evidently/data_validators/evidently_data_validator.py @@ -18,7 +18,6 @@ Any, ClassVar, Dict, - List, Optional, Sequence, Tuple, @@ -26,30 +25,6 @@ ) import pandas as pd -from evidently.dashboard import Dashboard # type: ignore -from evidently.dashboard.tabs import ( # type: ignore - CatTargetDriftTab, - ClassificationPerformanceTab, - DataDriftTab, - DataQualityTab, - NumTargetDriftTab, - ProbClassificationPerformanceTab, - RegressionPerformanceTab, -) -from evidently.dashboard.tabs.base_tab import Tab # type: ignore -from evidently.model_profile import Profile # type: ignore -from evidently.model_profile.sections import ( # type: ignore - CatTargetDriftProfileSection, - ClassificationPerformanceProfileSection, - DataDriftProfileSection, - DataQualityProfileSection, - NumTargetDriftProfileSection, - ProbClassificationPerformanceProfileSection, - RegressionPerformanceProfileSection, -) -from evidently.model_profile.sections.base_profile_section import ( # type: ignore - ProfileSection, -) from evidently.pipeline.column_mapping import ColumnMapping # type: ignore from evidently.report import Report # type: ignore from evidently.test_suite import TestSuite # type: ignore @@ -66,62 +41,6 @@ logger = get_logger(__name__) -profile_mapper = { - "datadrift": DataDriftProfileSection, - "categoricaltargetdrift": CatTargetDriftProfileSection, - "numericaltargetdrift": NumTargetDriftProfileSection, - "dataquality": DataQualityProfileSection, - "classificationmodelperformance": ClassificationPerformanceProfileSection, - "regressionmodelperformance": RegressionPerformanceProfileSection, - "probabilisticmodelperformance": ProbClassificationPerformanceProfileSection, -} - -dashboard_mapper = { - "dataquality": DataQualityTab, - "datadrift": DataDriftTab, - "categoricaltargetdrift": CatTargetDriftTab, - "numericaltargetdrift": NumTargetDriftTab, - "classificationmodelperformance": ClassificationPerformanceTab, - "regressionmodelperformance": RegressionPerformanceTab, - "probabilisticmodelperformance": ProbClassificationPerformanceTab, -} - - -def get_profile_sections_and_tabs( - profile_list: Optional[Sequence[str]], - verbose_level: int = 1, -) -> Tuple[List[ProfileSection], List[Tab]]: - """Get the profile sections and dashboard tabs for a profile list. - - Args: - profile_list: List of identifiers for Evidently profiles. - verbose_level: Verbosity level for the rendered dashboard. Use - 0 for a brief dashboard, 1 for a detailed dashboard. - - Returns: - A tuple of two lists of profile sections and tabs. - - Raises: - ValueError: if the profile_section is not supported. - """ - profile_list = profile_list or list(profile_mapper.keys()) - try: - return ( - [profile_mapper[profile]() for profile in profile_list], - [ - dashboard_mapper[profile](verbose_level=verbose_level) - for profile in profile_list - ], - ) - except KeyError as e: - nl = "\n" - raise ValueError( - f"Invalid profile sections: {profile_list} \n\n" - f"Valid and supported options are: {nl}- " - f'{f"{nl}- ".join(list(profile_mapper.keys()))}' - ) from e - - class EvidentlyDataValidator(BaseDataValidator): """Evidently data validator stack component.""" @@ -339,71 +258,3 @@ def data_validation( ) return test_suite - - def legacy_data_profiling( - self, - dataset: pd.DataFrame, - comparison_dataset: Optional[pd.DataFrame] = None, - profile_list: Optional[Sequence[str]] = None, - column_mapping: Optional[ColumnMapping] = None, - verbose_level: int = 1, - profile_options: Sequence[Tuple[str, Dict[str, Any]]] = [], - dashboard_options: Sequence[Tuple[str, Dict[str, Any]]] = [], - **kwargs: Any, - ) -> Tuple[Profile, Dashboard]: - """Analyze a dataset and generate a data profile with Evidently. - - The method takes in an optional list of Evidently options to be passed - to the profile constructor (`profile_options`) and the dashboard - constructor (`dashboard_options`). Each element in the list must be - composed of two items: the first is a full class path of an Evidently - option `dataclass`, the second is a dictionary of kwargs with the actual - option parameters. - - Args: - dataset: Target dataset to be profiled. - comparison_dataset: Optional dataset to be used for data profiles - that require a baseline for comparison (e.g data drift profiles). - profile_list: Optional list identifying the categories of Evidently - data profiles to be generated. - column_mapping: Properties of the DataFrame columns used - verbose_level: Level of verbosity for the Evidently dashboards. Use - 0 for a brief dashboard, 1 for a detailed dashboard. - profile_options: Optional list of options to pass to the - profile constructor. - dashboard_options: Optional list of options to pass to the - dashboard constructor. - **kwargs: Extra keyword arguments (unused). - - Returns: - The Evidently Profile and Dashboard objects corresponding to the set - of generated profiles. - """ - logger.warning( - "The ZenML Evidently data profile step and data validator " - "methods that are still using Evidently Profile and Dashboard " - "objects are deprecated and will be removed in a future release. " - "Please use the new data report step and data validator methods " - "that make use of the Evidently Report and Test Suite objects " - "instead." - ) - - sections, tabs = get_profile_sections_and_tabs( - profile_list, verbose_level - ) - unpacked_profile_options = self._unpack_options(profile_options) - unpacked_dashboard_options = self._unpack_options(dashboard_options) - - dashboard = Dashboard(tabs=tabs, options=unpacked_dashboard_options) - dashboard.calculate( - reference_data=dataset, - current_data=comparison_dataset, - column_mapping=column_mapping, - ) - profile = Profile(sections=sections, options=unpacked_profile_options) - profile.calculate( - reference_data=dataset, - current_data=comparison_dataset, - column_mapping=column_mapping, - ) - return profile, dashboard diff --git a/src/zenml/integrations/evidently/materializers/__init__.py b/src/zenml/integrations/evidently/materializers/__init__.py deleted file mode 100644 index 5c5c72db32a..00000000000 --- a/src/zenml/integrations/evidently/materializers/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) ZenML GmbH 2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. -"""Evidently materializers.""" - -from zenml.integrations.evidently.materializers.evidently_profile_materializer import ( # noqa - EvidentlyProfileMaterializer, -) diff --git a/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py b/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py deleted file mode 100644 index ebab20ca940..00000000000 --- a/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) ZenML GmbH 2021. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. -"""Implementation of Evidently profile materializer.""" - -import os -from typing import Any, ClassVar, Tuple, Type - -from evidently.model_profile import Profile # type: ignore -from evidently.utils import NumpyEncoder # type: ignore - -from zenml.enums import ArtifactType -from zenml.logger import get_logger -from zenml.materializers.base_materializer import BaseMaterializer -from zenml.utils import source_utils, yaml_utils - -logger = get_logger(__name__) - -DEFAULT_FILENAME = "profile.json" - - -class EvidentlyProfileMaterializer(BaseMaterializer): - """Materializer to read data to and from an Evidently Profile.""" - - ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (Profile,) - ASSOCIATED_ARTIFACT_TYPE: ClassVar[ - ArtifactType - ] = ArtifactType.DATA_ANALYSIS - - def load(self, data_type: Type[Any]) -> Profile: - """Reads an Evidently Profile object from a json file. - - Args: - data_type: The type of the data to read. - - Returns: - The Evidently Profile - - Raises: - TypeError: if the json file contains an invalid data type. - """ - filepath = os.path.join(self.uri, DEFAULT_FILENAME) - contents = yaml_utils.read_json(filepath) - if not isinstance(contents, dict): - raise TypeError( - f"Contents {contents} was type {type(contents)} but expected " - f"dictionary" - ) - - section_types = contents.pop("section_types", []) - sections = [] - for section_type in section_types: - section_cls = source_utils.load(section_type) - section = section_cls() - section._result = contents[section.part_id()] - sections.append(section) - - return Profile(sections=sections) - - def save(self, data: Profile) -> None: - """Serialize an Evidently Profile to a json file. - - Args: - data: The Evidently Profile to be serialized. - """ - contents = data.object() - # include the list of profile sections in the serialized dictionary, - # so we'll be able to re-create them during de-serialization - contents["section_types"] = [ - source_utils.resolve(stage.__class__).import_path - for stage in data.stages - ] - - filepath = os.path.join(self.uri, DEFAULT_FILENAME) - yaml_utils.write_json(filepath, contents, encoder=NumpyEncoder) diff --git a/src/zenml/integrations/evidently/steps/__init__.py b/src/zenml/integrations/evidently/steps/__init__.py index c2a6a5c82de..baff052f4e1 100644 --- a/src/zenml/integrations/evidently/steps/__init__.py +++ b/src/zenml/integrations/evidently/steps/__init__.py @@ -20,6 +20,3 @@ from zenml.integrations.evidently.steps.evidently_test import ( evidently_test_step, ) -from zenml.integrations.evidently.steps.evidently_profile import ( - evidently_profile_step, -) diff --git a/src/zenml/integrations/evidently/steps/evidently_profile.py b/src/zenml/integrations/evidently/steps/evidently_profile.py deleted file mode 100644 index 81199920294..00000000000 --- a/src/zenml/integrations/evidently/steps/evidently_profile.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (c) ZenML GmbH 2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. -"""Implementation of the Evidently Profile Step.""" -from typing import Any, Dict, List, Optional, Sequence, Tuple, cast - -import pandas as pd -from evidently.model_profile import Profile # type: ignore[import] -from typing_extensions import Annotated - -from zenml import step -from zenml.integrations.evidently.column_mapping import ( - EvidentlyColumnMapping, -) -from zenml.integrations.evidently.data_validators import EvidentlyDataValidator -from zenml.types import HTMLString - - -@step -def evidently_profile_step( - reference_dataset: pd.DataFrame, - comparison_dataset: pd.DataFrame, - column_mapping: Optional[EvidentlyColumnMapping] = None, - ignored_cols: Optional[List[str]] = None, - profile_sections: Optional[Sequence[str]] = None, - verbose_level: int = 1, - profile_options: Optional[Sequence[Tuple[str, Dict[str, Any]]]] = None, - dashboard_options: Optional[Sequence[Tuple[str, Dict[str, Any]]]] = None, -) -> Tuple[Annotated[Profile, "profile"], Annotated[HTMLString, "dashboard"]]: - """Run model drift analyses on two input pandas datasets. - - Args: - reference_dataset: a Pandas DataFrame - comparison_dataset: a Pandas DataFrame of new data you wish to - compare against the reference data - column_mapping: properties of the DataFrame columns used - ignored_cols: columns to ignore during the Evidently profile step - profile_sections: a list identifying the Evidently profile sections to be - used. The following are valid options supported by Evidently: - - "datadrift" - - "categoricaltargetdrift" - - "numericaltargetdrift" - - "classificationmodelperformance" - - "regressionmodelperformance" - - "probabilisticmodelperformance" - verbose_level: Verbosity level for the Evidently dashboards. Use - 0 for a brief dashboard, 1 for a detailed dashboard. - profile_options: Optional list of options to pass to the - profile constructor. See `EvidentlyDataValidator._unpack_options`. - dashboard_options: Optional list of options to pass to the - dashboard constructor. See `EvidentlyDataValidator._unpack_options`. - - Returns: - profile: Evidently Profile generated for the data drift. - dashboard: HTML report extracted from an Evidently Dashboard generated - for the data drift. - - Raises: - ValueError: If ignored_cols is an empty list. - ValueError: If column is not found in reference or comparison dataset. - """ - data_validator = cast( - EvidentlyDataValidator, - EvidentlyDataValidator.get_active_data_validator(), - ) - column_mapping = None - - if ignored_cols is None: - pass - - elif not ignored_cols: - raise ValueError( - f"Expects None or list of columns in strings, but got {ignored_cols}" - ) - - elif not set(ignored_cols).issubset( - set(reference_dataset.columns) - ) or not set(ignored_cols).issubset(set(comparison_dataset.columns)): - raise ValueError( - "Column is not found in reference or comparison datasets" - ) - - else: - reference_dataset = reference_dataset.drop( - labels=list(ignored_cols), axis=1 - ) - comparison_dataset = comparison_dataset.drop( - labels=list(ignored_cols), axis=1 - ) - - if column_mapping: - column_mapping = column_mapping.to_evidently_column_mapping() - - profile, dashboard = data_validator.legacy_data_profiling( - dataset=reference_dataset, - comparison_dataset=comparison_dataset, - profile_list=profile_sections, - column_mapping=column_mapping, - verbose_level=verbose_level, - profile_options=profile_options or [], - dashboard_options=dashboard_options or [], - ) - return profile, HTMLString(dashboard.html()) diff --git a/tests/unit/integrations/evidently/materializers/__init__.py b/tests/unit/integrations/evidently/materializers/__init__.py deleted file mode 100644 index 5e058539166..00000000000 --- a/tests/unit/integrations/evidently/materializers/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) ZenML GmbH 2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. diff --git a/tests/unit/integrations/evidently/materializers/test_evidently_profile_materializer.py b/tests/unit/integrations/evidently/materializers/test_evidently_profile_materializer.py deleted file mode 100644 index 797f3e4fa15..00000000000 --- a/tests/unit/integrations/evidently/materializers/test_evidently_profile_materializer.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) ZenML GmbH 2021. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. -"""Implementation of Evidently profile materializer.""" - -from evidently.model_profile import Profile -from evidently.model_profile.sections import DataDriftProfileSection - -from tests.unit.test_general import _test_materializer -from zenml.integrations.evidently.materializers.evidently_profile_materializer import ( - EvidentlyProfileMaterializer, -) - - -def test_evidently_profile_materializer(clean_client): - """Test the Evidently profile materializer.""" - _test_materializer( - step_output=Profile(sections=[DataDriftProfileSection()]), - materializer_class=EvidentlyProfileMaterializer, - expected_metadata_size=1, - ) diff --git a/tests/unit/integrations/evidently/steps/__init__.py b/tests/unit/integrations/evidently/steps/__init__.py deleted file mode 100644 index 5e058539166..00000000000 --- a/tests/unit/integrations/evidently/steps/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) ZenML GmbH 2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. diff --git a/tests/unit/integrations/evidently/steps/test_ignore_columns.py b/tests/unit/integrations/evidently/steps/test_ignore_columns.py deleted file mode 100644 index b28d93c5204..00000000000 --- a/tests/unit/integrations/evidently/steps/test_ignore_columns.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) ZenML GmbH 2022. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing -# permissions and limitations under the License. -# TODO: [HIGH] Fix this test code (from external PR) -# import pandas as pd -# import pytest -# from pydantic import ValidationError - -# from zenml.integrations.evidently.steps.evidently_profile import ( -# EvidentlyColumnMapping, -# EvidentlyProfileConfig, -# EvidentlyProfileStep, -# ) - -# ref = pd.DataFrame() -# ref["target"] = ["A", "B", "B", "C", "A"] -# ref["prediction"] = [0.12, -0.54, 0.08, 1.78, 0.03] -# ref["ignored_col"] = [1, 5, 1, 89, 0] -# ref["var_A"] = [1, 5, 3, 10, 25] -# ref["var_B"] = [0.58, 0.23, 1.25, -0.14, 0] - -# comp = pd.DataFrame() -# comp["target"] = ["B", "C", "A", "A", "C"] -# comp["prediction"] = [0.12, -0.54, 0.08, 1.78, 0.03] -# comp["ignored_col"] = [3, 1, 1, 120, 1] -# comp["var_A"] = [0, 27, 3, 4, 8] -# comp["var_B"] = [0.12, -0.54, 0.08, 1.78, 0.03] - - -# def test_ignore_cols_succeeds() -> None: -# """Tests ignored_cols parameter with features ignore_col and var_C -# to be ignored""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) - -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols=["ignored_col", "var_B"], -# ) - -# profile_step = EvidentlyProfileStep() - -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# ) - -# target = [drift_obj["data_drift"]["data"]["utility_columns"]["target"]] -# prediction = [ -# drift_obj["data_drift"]["data"]["utility_columns"]["prediction"] -# ] -# cat_feat_names = drift_obj["data_drift"]["data"]["cat_feature_names"] -# num_feat_names = drift_obj["data_drift"]["data"]["num_feature_names"] - -# assert ( -# "ignored_col" -# not in target + prediction + cat_feat_names + num_feat_names -# ) -# assert "var_B" not in target + prediction + cat_feat_names + num_feat_names - - -# def test_do_not_ignore_any_columns() -> None: -# """Tests ignored_cols parameter with nothing to ignore -# i.e pass all features""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) - -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols=None, -# ) - -# profile_step = EvidentlyProfileStep() - -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# ) -# target = [drift_obj["data_drift"]["data"]["utility_columns"]["target"]] -# prediction = [ -# drift_obj["data_drift"]["data"]["utility_columns"]["prediction"] -# ] -# cat_feat_names = drift_obj["data_drift"]["data"]["cat_feature_names"] -# num_feat_names = drift_obj["data_drift"]["data"]["num_feature_names"] - -# all_cols = target + prediction + cat_feat_names + num_feat_names -# assert "target" in all_cols -# assert "prediction" in all_cols -# assert "ignored_col" in all_cols -# assert "var_A" in all_cols -# assert "var_B" in all_cols - - -# def test_ignoring_non_existing_column() -> None: -# """Tests ignored_cols parameter for non existing -# features and raises Error""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols=["var_A", "test_1"], -# ) - -# profile_step = EvidentlyProfileStep() - -# with pytest.raises(ValueError): -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# ) - - -# def test_ignoring_incorrect_datatype() -> None: -# """Tests ignored_cols parameter for incorrect datatype -# and raises Error""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols="var_A", -# ) - -# profile_step = EvidentlyProfileStep() - -# with pytest.raises(ValidationError): -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# ) - - -# def test_ignored_cols_elements() -> None: -# """Tests ignored_cols parameter for type of its elements -# and raises Error""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols=["Housing", "Region", 25, True], -# ) - -# profile_step = EvidentlyProfileStep() - -# with pytest.raises(ValueError): -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# ) - - -# def test_empty_ignored_cols() -> None: -# """Tests for empty ignored_cols parameter -# and raises Error""" - -# column_map = EvidentlyColumnMapping(target_names=["target"]) -# profile_config = EvidentlyProfileConfig( -# profile_sections=["datadrift"], -# column_mapping=column_map, -# ignored_cols=[], -# ) - -# profile_step = EvidentlyProfileStep() - -# with pytest.raises(ValueError): -# drift_obj, dash_obj = profile_step.entrypoint( -# reference_dataset=ref, -# comparison_dataset=comp, -# config=profile_config, -# )