From 5fd5c3f33ddb68b25605fe0a9ff917546b44815c Mon Sep 17 00:00:00 2001 From: Alex Strick van Linschoten Date: Thu, 24 Aug 2023 23:38:54 +0200 Subject: [PATCH 1/3] Bump `ruff` and `mypy` --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d4f8229cf49..d35ce877856 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ orjson = { version = "~3.8.3", optional = true} copier = { version = ">=7.0.0", optional = true } jinja2-time = { version = "^0.2.0", optional = true } black = { version = "^23.3.0", optional = true } -ruff = { version = "^0.0.282", optional = true } +ruff = { version = "^0.0.285", optional = true } # Optional dependencies for the AWS secrets store boto3 = { version=">=1.16.0,<=1.24.59", optional = true } @@ -126,7 +126,7 @@ adlfs = {version = ">=2021.10.0", optional = true} # Optional development dependencies coverage = { extras = ["toml"], version = "^5.5", optional = true } -mypy = { version = "1.3.0", optional = true } +mypy = { version = "1.5.1", optional = true } pre-commit = { version = "^2.14.0", optional = true } pyment = { version = "^0.3.3", optional = true } tox = { version = "^3.24.3", optional = true } From 9f3e4f63decd7213a106ae42e43365c3d2aa3334 Mon Sep 17 00:00:00 2001 From: Alex Strick van Linschoten Date: Fri, 25 Aug 2023 00:18:58 +0200 Subject: [PATCH 2/3] new ruff linting fixes --- .../evidently/materializers/evidently_profile_materializer.py | 2 +- tests/unit/steps/test_base_step.py | 4 ++-- tests/unit/steps/test_base_step_new.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py b/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py index 421fb02033b..ebab20ca940 100644 --- a/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py +++ b/src/zenml/integrations/evidently/materializers/evidently_profile_materializer.py @@ -51,7 +51,7 @@ def load(self, data_type: Type[Any]) -> Profile: """ filepath = os.path.join(self.uri, DEFAULT_FILENAME) contents = yaml_utils.read_json(filepath) - if type(contents) != dict: + if not isinstance(contents, dict): raise TypeError( f"Contents {contents} was type {type(contents)} but expected " f"dictionary" diff --git a/tests/unit/steps/test_base_step.py b/tests/unit/steps/test_base_step.py index f3e06774d8e..4aa30ff0dd5 100644 --- a/tests/unit/steps/test_base_step.py +++ b/tests/unit/steps/test_base_step.py @@ -620,8 +620,8 @@ def raw_artifact_test_step_3( @step def raw_artifact_test_step_4(dict_: Dict, list_: List) -> None: - assert type(dict_) is dict - assert type(list_) is list + assert isinstance(dict_, dict) + assert isinstance(list_, list) def test_step_can_have_raw_artifacts(clean_client): diff --git a/tests/unit/steps/test_base_step_new.py b/tests/unit/steps/test_base_step_new.py index 6d272b7383f..9745c6d438b 100644 --- a/tests/unit/steps/test_base_step_new.py +++ b/tests/unit/steps/test_base_step_new.py @@ -38,11 +38,11 @@ def test_input_validation_outside_of_pipeline(): output = step_with_int_input(input_=1) assert output == 1 - assert type(output) is int + assert isinstance(output, int) output = step_with_int_input(input_=3.0) assert output == 3 - assert type(output) is int + assert isinstance(output, int) def test_input_validation_inside_pipeline(): From 0172e4cd088757bda23b6ecd43d84e15df781051 Mon Sep 17 00:00:00 2001 From: Alex Strick van Linschoten Date: Fri, 25 Aug 2023 07:19:31 +0200 Subject: [PATCH 3/3] remove unused type ignore (mypy) --- src/zenml/cli/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zenml/cli/utils.py b/src/zenml/cli/utils.py index ba39f5f4690..23d93ad2296 100644 --- a/src/zenml/cli/utils.py +++ b/src/zenml/cli/utils.py @@ -258,7 +258,7 @@ def __dictify(model: T) -> Dict[str, str]: # Explicitly defined columns take precedence over exclude columns if not columns: include_columns = [ - k for k in model.dict().keys() if k not in exclude_columns # type: ignore[operator] + k for k in model.dict().keys() if k not in exclude_columns ] else: include_columns = columns