diff --git a/packages/aws-library/src/aws_library/s3/_errors.py b/packages/aws-library/src/aws_library/s3/_errors.py index d14105dbd30..3bafa217257 100644 --- a/packages/aws-library/src/aws_library/s3/_errors.py +++ b/packages/aws-library/src/aws_library/s3/_errors.py @@ -10,25 +10,20 @@ class S3NotConnectedError(S3RuntimeError): class S3AccessError(S3RuntimeError): - code = "s3_access.error" # type: ignore[assignment] msg_template: str = "Unexpected error while accessing S3 backend" class S3BucketInvalidError(S3AccessError): - code = "s3_bucket.invalid_error" # type: ignore[assignment] msg_template: str = "The bucket '{bucket}' is invalid" class S3KeyNotFoundError(S3AccessError): - code = "s3_key.not_found_error" # type: ignore[assignment] msg_template: str = "The file {key} in {bucket} was not found" class S3UploadNotFoundError(S3AccessError): - code = "s3_upload.not_found_error" # type: ignore[assignment] msg_template: str = "The upload for {key} in {bucket} was not found" class S3DestinationNotEmptyError(S3AccessError): - code = "s3_destination.not_empty_error" # type: ignore[assignment] msg_template: str = "The destination {dst_prefix} is not empty" diff --git a/packages/common-library/tests/test_errors_classes.py b/packages/common-library/tests/test_errors_classes.py index 3be2532f1ab..efe4c44b86e 100644 --- a/packages/common-library/tests/test_errors_classes.py +++ b/packages/common-library/tests/test_errors_classes.py @@ -49,12 +49,10 @@ class MyValueError(MyBaseError, ValueError): assert f"{error}" == "Wrong value 42" class MyTypeError(MyBaseError, TypeError): - code = "i_want_this" msg_template = "Wrong type {type}" error = MyTypeError(type="int") - assert error.code == "i_want_this" assert f"{error}" == "Wrong type int" diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py index f0a6813ba15..1597ddfb6f4 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py @@ -5,16 +5,14 @@ class TaskValueError(OsparcErrorMixin, ValueError): - code = "task.value_error" # type: ignore[assignment] + ... class TaskCancelledError(OsparcErrorMixin, RuntimeError): - code = "task.cancelled_error" # type: ignore[assignment] msg_template = "The task was cancelled" class ServiceRuntimeError(OsparcErrorMixin, RuntimeError): - code = "service.runtime_error" # type: ignore[assignment] msg_template = ( "The service {service_key}:{service_version}" " running in container {container_id} failed with code" diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py index 80170682430..c2e722b6697 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py @@ -66,14 +66,14 @@ def regex_pattern(self) -> str: if self.oneOf: msg = "Current version cannot compute regex patterns in case of oneOf. Please go ahead and implement it yourself." raise NotImplementedError(msg) - if self.anyOf: + if self.anyOf is not None: return "|".join( [ elm.regex_pattern for elm in self.anyOf # pylint:disable=not-an-iterable ] ) - if self.allOf: + if self.allOf is not None: return "&".join( [ elm.regex_pattern diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py index b33e677c0bf..c6596e669e9 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py @@ -23,7 +23,6 @@ class PortValueError(OsparcErrorMixin, ValueError): - code = "port_validation.schema_error" # type: ignore msg_template = "Invalid value in port {port_key!r}: {schema_error_message}" # pylint: disable=useless-super-delegation @@ -38,7 +37,6 @@ def __init__(self, *, port_key: str, schema_error: JsonSchemaValidationError): class PortUnitError(OsparcErrorMixin, ValueError): - code = "port_validation.unit_error" # type: ignore msg_template = "Invalid unit in port {port_key!r}: {pint_error_msg}" # pylint: disable=useless-super-delegation diff --git a/services/director-v2/src/simcore_service_director_v2/core/errors.py b/services/director-v2/src/simcore_service_director_v2/core/errors.py index 213cd4744bf..65af83fa28f 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/errors.py +++ b/services/director-v2/src/simcore_service_director_v2/core/errors.py @@ -167,8 +167,6 @@ def get_errors(self) -> list[ErrorDict]: class MissingComputationalResourcesError(TaskSchedulingError): """A task cannot be scheduled because the cluster does not have the required resources""" - code = "scheduler_error.missing_resources" - def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None): super().__init__(project_id, node_id, msg=msg) @@ -176,8 +174,6 @@ def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = Non class InsuficientComputationalResourcesError(TaskSchedulingError): """A task cannot be scheduled because the cluster does not have *enough* of the required resources""" - code = "scheduler_error.insuficient_resources" - def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None): super().__init__(project_id, node_id, msg=msg) diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py index 8b40a4e0f35..e3d67da68aa 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py @@ -40,5 +40,4 @@ class LegacyServiceIsNotSupportedError(DirectorError): class UnexpectedContainerStatusError(OsparcErrorMixin, DynamicSidecarError): - code = "dynamic_sidecar.container_status" # type: ignore msg_template = "Unexpected status from containers: {containers_with_error}" diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py index 2677b7bc370..0dd4b43e4bd 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py @@ -2,4 +2,4 @@ class BaseDynamicSchedulerError(OsparcErrorMixin, ValueError): - code = "simcore.service.dynamic.scheduler" # type:ignore[assignment] + ... diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py index 636260814a1..bd74b68dfb7 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py @@ -36,7 +36,7 @@ def __init__(self, message: str, status_code: int) -> None: class BaseError(OsparcErrorMixin, BaseDynamicSidecarError): - code = "dy_sidecar.error" # type: ignore[assignment] + ... class ContainerExecContainerNotFoundError(BaseError): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py index b2c4a327c83..278ad52b04d 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py @@ -2,7 +2,7 @@ class BaseServicesPreferencesError(OsparcErrorMixin, Exception): - code = "dynamic_sidecar.user_service_preferences" # type: ignore[assignment] + ... class DestinationIsNotADirectoryError(BaseServicesPreferencesError): diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_errors.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_errors.py index 5cff412f415..4c7c0bbce73 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_errors.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_errors.py @@ -6,22 +6,18 @@ class StudyDispatcherError(WebServerBaseError, ValueError): class IncompatibleService(StudyDispatcherError): - code = "studies_dispatcher.incompatible_service" # type: ignore msg_template = "None of the registered services can handle '{file_type}'" class FileToLarge(StudyDispatcherError): - code = "studies_dispatcher.file_to_large" # type: ignore msg_template = "File size {file_size_in_mb} MB is over allowed limit" class ServiceNotFound(StudyDispatcherError): - code = "studies_dispatcher.service_not_found" # type: ignore msg_template = "Service {service_key}:{service_version} not found" class InvalidRedirectionParams(StudyDispatcherError): - code = "studies_dispatcher.invalid_redirection_params" # type: ignore msg_template = ( "The link you provided is invalid because it doesn't contain any information related to data or a service." " Please check the link and make sure it is correct."