diff --git a/CHANGELOG.md b/CHANGELOG.md index c8b8494da5..0f3c0d5db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ The types of changes are: * Added more taxonomy fields that can be edited via the UI [#1000](https://github.com/ethyca/fides/pull/1000) +### Fixed + +* Fixed failing mypy tests [#1030](https://github.com/ethyca/fides/pull/1030) + ## [1.8.2](https://github.com/ethyca/fides/compare/1.8.1...1.8.2) - 2022-08-18 ### Added diff --git a/src/fidesctl/ctl/core/config/cli_settings.py b/src/fidesctl/ctl/core/config/cli_settings.py index 3f9cdadaaf..9e26019bcf 100644 --- a/src/fidesctl/ctl/core/config/cli_settings.py +++ b/src/fidesctl/ctl/core/config/cli_settings.py @@ -21,7 +21,8 @@ class FidesctlCLISettings(FidesSettings): server_url: Optional[AnyHttpUrl] @validator("server_url", always=True) - def get_server_url(cls: FidesSettings, value: str, values: Dict) -> str: + @classmethod + def get_server_url(cls, value: str, values: Dict) -> str: "Create the server_url." host = values["server_host"] port = values["server_port"] diff --git a/src/fidesctl/ctl/core/config/logging_settings.py b/src/fidesctl/ctl/core/config/logging_settings.py index 6396ba99bd..c4f9a6d9b6 100644 --- a/src/fidesctl/ctl/core/config/logging_settings.py +++ b/src/fidesctl/ctl/core/config/logging_settings.py @@ -19,14 +19,16 @@ class FidesctlLoggingSettings(FidesSettings): serialization: str = "" @validator("destination", pre=True) - def get_destination(cls: FidesSettings, value: str) -> str: + @classmethod + def get_destination(cls, value: str) -> str: """ Print logs to sys.stdout, unless a valid file path is specified. """ return value if os.path.exists(value) else "" @validator("level", pre=True) - def get_level(cls: FidesSettings, value: str) -> str: + @classmethod + def get_level(cls, value: str) -> str: """ Set the logging level to DEBUG if in test mode, INFO by default. Ensures that the string-form of a valid logging._Level is @@ -41,7 +43,8 @@ def get_level(cls: FidesSettings, value: str) -> str: return value if getLevelName(value) != f"Level {value}" else getLevelName(INFO) @validator("serialization", pre=True) - def get_serialization(cls: FidesSettings, value: str) -> str: + @classmethod + def get_serialization(cls, value: str) -> str: """ Ensure that only JSON serialization, or no serialization, is used. """ diff --git a/src/fidesctl/ctl/core/config/user_settings.py b/src/fidesctl/ctl/core/config/user_settings.py index e950b56edf..d064345216 100644 --- a/src/fidesctl/ctl/core/config/user_settings.py +++ b/src/fidesctl/ctl/core/config/user_settings.py @@ -4,7 +4,7 @@ from typing import Dict, Optional -from pydantic import BaseModel, validator +from pydantic import validator from fidesctl.ctl.core.utils import generate_request_headers @@ -22,9 +22,8 @@ class FidesctlUserSettings(FidesSettings): # Automatically generate the request_headers on object creation @validator("request_headers", pre=True, always=True) - def get_request_headers( - cls: BaseModel, value: Optional[Dict], values: Dict - ) -> Dict[str, str]: + @classmethod + def get_request_headers(cls, value: Optional[Dict], values: Dict) -> Dict[str, str]: return generate_request_headers(values["user_id"], values["api_key"]) class Config: