diff --git a/src/zenml/integrations/lightgbm/__init__.py b/src/zenml/integrations/lightgbm/__init__.py index 778b0fbbe5..d6797595f3 100644 --- a/src/zenml/integrations/lightgbm/__init__.py +++ b/src/zenml/integrations/lightgbm/__init__.py @@ -22,6 +22,7 @@ class LightGBMIntegration(Integration): NAME = LIGHTGBM REQUIREMENTS = ["lightgbm>=1.0.0"] + APT_PACKAGES = ["libgomp1"] @classmethod def activate(cls) -> None: diff --git a/src/zenml/integrations/mlflow/services/mlflow_deployment.py b/src/zenml/integrations/mlflow/services/mlflow_deployment.py index 2cdccdbbf0..166f5bdc36 100644 --- a/src/zenml/integrations/mlflow/services/mlflow_deployment.py +++ b/src/zenml/integrations/mlflow/services/mlflow_deployment.py @@ -260,7 +260,7 @@ def predict( ) if self.endpoint.prediction_url is not None: - if type(request) == pd.DataFrame: + if type(request) is pd.DataFrame: response = requests.post( # nosec self.endpoint.prediction_url, json={"instances": request.to_dict("records")}, diff --git a/src/zenml/materializers/built_in_materializer.py b/src/zenml/materializers/built_in_materializer.py index 0d8a3c6bf5..92429e7835 100644 --- a/src/zenml/materializers/built_in_materializer.py +++ b/src/zenml/materializers/built_in_materializer.py @@ -80,7 +80,7 @@ def load( The data read. """ contents = yaml_utils.read_json(self.data_path) - if type(contents) != data_type: + if type(contents) is not data_type: # TODO [ENG-142]: Raise error or try to coerce logger.debug( f"Contents {contents} was type {type(contents)} but expected " diff --git a/src/zenml/materializers/cloudpickle_materializer.py b/src/zenml/materializers/cloudpickle_materializer.py index 00e3785b04..399ca7f233 100644 --- a/src/zenml/materializers/cloudpickle_materializer.py +++ b/src/zenml/materializers/cloudpickle_materializer.py @@ -94,7 +94,7 @@ def save(self, data: Any) -> None: """ # Log a warning if this materializer was not explicitly specified for # the given data type. - if type(self) == CloudpickleMaterializer: + if type(self) is CloudpickleMaterializer: logger.warning( f"No materializer is registered for type `{type(data)}`, so " "the default Pickle materializer was used. Pickle is not " diff --git a/src/zenml/utils/function_utils.py b/src/zenml/utils/function_utils.py index ebf309340a..e02f1e8af0 100644 --- a/src/zenml/utils/function_utils.py +++ b/src/zenml/utils/function_utils.py @@ -107,7 +107,7 @@ def _is_valid_optional_arg(arg_type: Any) -> bool: if ( args[0] not in _ALLOWED_TYPES and not _is_valid_collection_arg(args[0]) - ) or args[1] != type(None): + ) or args[1] is not type(None): return False return True return False diff --git a/src/zenml/utils/pipeline_docker_image_builder.py b/src/zenml/utils/pipeline_docker_image_builder.py index fd22797784..d5c43c9e5b 100644 --- a/src/zenml/utils/pipeline_docker_image_builder.py +++ b/src/zenml/utils/pipeline_docker_image_builder.py @@ -297,6 +297,14 @@ def build_docker_image( if docker_settings.install_stack_requirements: apt_packages += stack.apt_packages + # include apt packages from all required integrations + for integration in docker_settings.required_integrations: + # get the integration + integration_cls = integration_registry.integrations[ + integration + ] + apt_packages += integration_cls.APT_PACKAGES + if apt_packages: logger.info( "Including apt packages: %s",