Skip to content

Commit 3250e5d

Browse files
♻️ Greenify pylint (after Pydantic v2 migration) (#6747)
1 parent c10d7d0 commit 3250e5d

File tree

11 files changed

+6
-26
lines changed

11 files changed

+6
-26
lines changed

packages/aws-library/src/aws_library/s3/_errors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,20 @@ class S3NotConnectedError(S3RuntimeError):
1010

1111

1212
class S3AccessError(S3RuntimeError):
13-
code = "s3_access.error" # type: ignore[assignment]
1413
msg_template: str = "Unexpected error while accessing S3 backend"
1514

1615

1716
class S3BucketInvalidError(S3AccessError):
18-
code = "s3_bucket.invalid_error" # type: ignore[assignment]
1917
msg_template: str = "The bucket '{bucket}' is invalid"
2018

2119

2220
class S3KeyNotFoundError(S3AccessError):
23-
code = "s3_key.not_found_error" # type: ignore[assignment]
2421
msg_template: str = "The file {key} in {bucket} was not found"
2522

2623

2724
class S3UploadNotFoundError(S3AccessError):
28-
code = "s3_upload.not_found_error" # type: ignore[assignment]
2925
msg_template: str = "The upload for {key} in {bucket} was not found"
3026

3127

3228
class S3DestinationNotEmptyError(S3AccessError):
33-
code = "s3_destination.not_empty_error" # type: ignore[assignment]
3429
msg_template: str = "The destination {dst_prefix} is not empty"

packages/common-library/tests/test_errors_classes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ class MyValueError(MyBaseError, ValueError):
4949
assert f"{error}" == "Wrong value 42"
5050

5151
class MyTypeError(MyBaseError, TypeError):
52-
code = "i_want_this"
5352
msg_template = "Wrong type {type}"
5453

5554
error = MyTypeError(type="int")
5655

57-
assert error.code == "i_want_this"
5856
assert f"{error}" == "Wrong type int"
5957

6058

packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55

66

77
class TaskValueError(OsparcErrorMixin, ValueError):
8-
code = "task.value_error" # type: ignore[assignment]
8+
...
99

1010

1111
class TaskCancelledError(OsparcErrorMixin, RuntimeError):
12-
code = "task.cancelled_error" # type: ignore[assignment]
1312
msg_template = "The task was cancelled"
1413

1514

1615
class ServiceRuntimeError(OsparcErrorMixin, RuntimeError):
17-
code = "service.runtime_error" # type: ignore[assignment]
1816
msg_template = (
1917
"The service {service_key}:{service_version}"
2018
" running in container {container_id} failed with code"

packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ def regex_pattern(self) -> str:
6666
if self.oneOf:
6767
msg = "Current version cannot compute regex patterns in case of oneOf. Please go ahead and implement it yourself."
6868
raise NotImplementedError(msg)
69-
if self.anyOf:
69+
if self.anyOf is not None:
7070
return "|".join(
7171
[
7272
elm.regex_pattern
7373
for elm in self.anyOf # pylint:disable=not-an-iterable
7474
]
7575
)
76-
if self.allOf:
76+
if self.allOf is not None:
7777
return "&".join(
7878
[
7979
elm.regex_pattern

packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424

2525
class PortValueError(OsparcErrorMixin, ValueError):
26-
code = "port_validation.schema_error" # type: ignore
2726
msg_template = "Invalid value in port {port_key!r}: {schema_error_message}"
2827

2928
# pylint: disable=useless-super-delegation
@@ -38,7 +37,6 @@ def __init__(self, *, port_key: str, schema_error: JsonSchemaValidationError):
3837

3938

4039
class PortUnitError(OsparcErrorMixin, ValueError):
41-
code = "port_validation.unit_error" # type: ignore
4240
msg_template = "Invalid unit in port {port_key!r}: {pint_error_msg}"
4341

4442
# pylint: disable=useless-super-delegation

services/director-v2/src/simcore_service_director_v2/core/errors.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,13 @@ def get_errors(self) -> list[ErrorDict]:
167167
class MissingComputationalResourcesError(TaskSchedulingError):
168168
"""A task cannot be scheduled because the cluster does not have the required resources"""
169169

170-
code = "scheduler_error.missing_resources"
171-
172170
def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None):
173171
super().__init__(project_id, node_id, msg=msg)
174172

175173

176174
class InsuficientComputationalResourcesError(TaskSchedulingError):
177175
"""A task cannot be scheduled because the cluster does not have *enough* of the required resources"""
178176

179-
code = "scheduler_error.insuficient_resources"
180-
181177
def __init__(self, project_id: ProjectID, node_id: NodeID, msg: str | None = None):
182178
super().__init__(project_id, node_id, msg=msg)
183179

services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ class LegacyServiceIsNotSupportedError(DirectorError):
4040

4141

4242
class UnexpectedContainerStatusError(OsparcErrorMixin, DynamicSidecarError):
43-
code = "dynamic_sidecar.container_status" # type: ignore
4443
msg_template = "Unexpected status from containers: {containers_with_error}"

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class BaseDynamicSchedulerError(OsparcErrorMixin, ValueError):
5-
code = "simcore.service.dynamic.scheduler" # type:ignore[assignment]
5+
...

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, message: str, status_code: int) -> None:
3636

3737

3838
class BaseError(OsparcErrorMixin, BaseDynamicSidecarError):
39-
code = "dy_sidecar.error" # type: ignore[assignment]
39+
...
4040

4141

4242
class ContainerExecContainerNotFoundError(BaseError):

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class BaseServicesPreferencesError(OsparcErrorMixin, Exception):
5-
code = "dynamic_sidecar.user_service_preferences" # type: ignore[assignment]
5+
...
66

77

88
class DestinationIsNotADirectoryError(BaseServicesPreferencesError):

0 commit comments

Comments
 (0)