Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Pydantic v2 migration #6578

Merged
merged 80 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d2d81c0
⬆️ Upgrade models-library (pydantic v2) (#6333)
giancarloromeo Sep 18, 2024
19e3923
♻️ Add common library (#6495)
giancarloromeo Oct 7, 2024
1d92881
⬆️ Upgrade libraries (pydantic v2) (#6366)
giancarloromeo Oct 9, 2024
329b00d
Upgrade agent service (Pydantic v2) (#6508)
giancarloromeo Oct 10, 2024
6786b92
Upgrade EFS guardian service (Pydantic v2) (#6516)
giancarloromeo Oct 11, 2024
bbe92a2
Upgrade invitations service (Pydantic v2) (#6513)
giancarloromeo Oct 11, 2024
42c0a68
Upgrade clusters keeper service (Pydantic v2) (#6519)
giancarloromeo Oct 14, 2024
1c833e0
Merge remote-tracking branch 'origin/master' into pydantic_v2_migrati…
sanderegg Oct 22, 2024
cac8134
♻️Pydantic V2 upgrade: autoscaling (#6535)
sanderegg Oct 15, 2024
e97258e
🎨 pydantic2 migration: fixed unit-tests for dynamic-sidecar (#6534)
GitHK Oct 18, 2024
463488b
🎨 pydantic2 migration: fixed unit-tests for dynamic-scheduler (#6547)
GitHK Oct 18, 2024
c2b4983
🎨 pydantic2 migration: fixed unit-tests for agent (#6546)
GitHK Oct 18, 2024
64293f0
🎨 pydantic2 migration: fixed unit-tests for payments (#6553)
GitHK Oct 18, 2024
cf5546b
Upgrade resource usage tracker (Pydantic v2) (#6517)
giancarloromeo Oct 21, 2024
3b188f5
Merge remote-tracking branch 'origin/master' into pydantic_v2_migrati…
sanderegg Oct 22, 2024
4716e55
Merge remote-tracking branch 'origin/master' into pydantic_v2_migrati…
sanderegg Oct 22, 2024
84f1e51
missing file from re-creating branch
sanderegg Oct 22, 2024
cf95d81
restored from old pydanitc_v2_migration branch
sanderegg Oct 22, 2024
7be9541
fixes after merge
sanderegg Oct 22, 2024
6199ed6
⬆️Dask sidecar: migration to v2 (#6591)
sanderegg Oct 24, 2024
cd6f545
♻️Use correct import (#6597)
sanderegg Oct 24, 2024
3cf68ba
⬆️Datcore adapter: migration (#6594)
sanderegg Oct 24, 2024
fb48eb1
Merge remote-tracking branch 'upstream/master' into update-branch
sanderegg Oct 25, 2024
82c69d0
Merge pull request #6600 from sanderegg/update-branch
sanderegg Oct 25, 2024
7410516
⬆️Migration: Storage (#6599)
sanderegg Oct 25, 2024
39aed6a
⬆️ Upgrade API Server service (Pydantic v2) (#6580)
giancarloromeo Oct 25, 2024
e38cf4e
♻️Fix settings library tests (#6605)
sanderegg Oct 28, 2024
00f8674
Merge remote-tracking branch 'upstream/master' into update-branch2
sanderegg Oct 28, 2024
06df37d
Merge pull request #6609 from sanderegg/update-branch2
sanderegg Oct 28, 2024
3195f1e
Merge remote-tracking branch 'upstream/master' into upgrade-master-3
sanderegg Oct 29, 2024
7033151
Merge remote-tracking branch 'upstream/master' into upgrade-master-3
sanderegg Oct 29, 2024
4fd252f
Merge pull request #6626 from sanderegg/upgrade-master-3
sanderegg Oct 29, 2024
afa0b3c
⬆️ upgrades `iter_model_examples_in_module` to enable all example te…
pcrespov Oct 29, 2024
9e76d4f
⬆️Pydantic V2: Diverse fixes after merges from master (#6627)
sanderegg Oct 29, 2024
fefd1b9
Merge remote-tracking branch 'upstream/master' into upgrade-master-5
sanderegg Oct 29, 2024
05cff9e
Merge pull request #6637 from sanderegg/upgrade-master-5
sanderegg Oct 29, 2024
34c9f3e
⬆️ pydantic migration catalog (#6629)
pcrespov Oct 31, 2024
ee66b3d
Merge remote-tracking branch 'upstream/master' into update-master-6
sanderegg Nov 1, 2024
01769ac
Merge pull request #6645 from sanderegg/update-master-6
sanderegg Nov 1, 2024
2486b38
♻️Pydantic V2 migration: various fixes (#6647)
sanderegg Nov 1, 2024
add4b61
Merge remote-tracking branch 'upstream/master' into update-master-7
sanderegg Nov 1, 2024
1fe311d
Merge pull request #6650 from sanderegg/update-master-7
sanderegg Nov 1, 2024
24218c1
⬆️ Pydantic V2: after upstream merge -> fixes (#6651)
sanderegg Nov 1, 2024
b01c4a7
⬆️ Fix custom settings class with `pydantic-settings~=2.6` (#6644)
pcrespov Nov 5, 2024
8402270
⬆️ Upgrade Web Server service (Pydantic v2) (#6584)
giancarloromeo Nov 6, 2024
0527b1e
🐛 pydantic v2 fixed broken unit tests (#6649)
GitHK Nov 6, 2024
7d0fbdb
Merge remote-tracking branch 'upstream/master' into update-from-maste…
sanderegg Nov 8, 2024
c106d0a
Merge pull request #6689 from sanderegg/update-from-master-10
sanderegg Nov 8, 2024
60fe257
🎨 Add examples to pydantic response models (#6658)
bisgaard-itis Nov 8, 2024
f07afbf
🐛 Fixed packages mypy, pylint and tests (#6678)
GitHK Nov 11, 2024
a00d55f
pydantic2 making ported services green (#6701)
GitHK Nov 13, 2024
f335bca
WIP: ⬆️ Upgrade Director v2 service (Pydantic v2) (#6619)
giancarloromeo Nov 14, 2024
db084cd
Merge remote-tracking branch 'upstream/master' into update-master-20
sanderegg Nov 14, 2024
44bc9f7
Merge pull request #6724 from sanderegg/update-master-20
sanderegg Nov 15, 2024
a2d3742
♻️ Fix unit tests after master merge (#6727)
giancarloromeo Nov 15, 2024
327beab
⬆️ Align versions for pydantic/fastapi (#6730)
giancarloromeo Nov 15, 2024
84c4c85
♻️Fixed Unit test director v2 (#6733)
sanderegg Nov 15, 2024
8eac56b
♻️ Fix deprecated stuff (Pydantic v2) (#6732)
giancarloromeo Nov 18, 2024
65665ec
♻️ Migrate scripts (Pydantic v2) (#6741)
giancarloromeo Nov 18, 2024
57058f9
Merge remote-tracking branch 'upstream/master' into update-from-maste…
sanderegg Nov 18, 2024
44f85bf
Merge pull request #6744 from sanderegg/update-from-master-XXX
sanderegg Nov 18, 2024
fa57c9e
pydantic2 migration made integration tests green (#6719)
GitHK Nov 18, 2024
a6802c9
⬆️✅ Fixes settings tests (#6753)
pcrespov Nov 18, 2024
75f06e4
🐛 Fixed webserver API endpoints (#6751)
GitHK Nov 19, 2024
aa756f0
Merge remote-tracking branch 'upstream/master' into update-master-XXX
sanderegg Nov 19, 2024
bcf3327
Merge remote-tracking branch 'upstream/master' into update-master-XXX
sanderegg Nov 19, 2024
373c314
Merge pull request #6754 from sanderegg/update-master-XXX
sanderegg Nov 19, 2024
f442e63
⬆️Pydantic V2: Migrate director v0 + some fixes from query PR (#6755)
sanderegg Nov 19, 2024
c10d7d0
⬆️♻️ Fix/test models (#6758)
pcrespov Nov 19, 2024
3250e5d
♻️ Greenify pylint (after Pydantic v2 migration) (#6747)
giancarloromeo Nov 19, 2024
dcdc863
🎨 Ensure profiling middleware is compatible with fastapi (#6760)
bisgaard-itis Nov 19, 2024
c50d79c
♻️Pydantic V2: Unify errors dv 2 (#6763)
sanderegg Nov 19, 2024
0aea337
Uses typing_extensions.TypedDict in all instances used in pydantic mo…
pcrespov Nov 19, 2024
c49f421
♻️ Cleanup network AnyHttpUrlLegacy and HttpUrlLegacy (#6767)
giancarloromeo Nov 20, 2024
a0b8a2f
All errors in dynamic-sidecar inherit from `OsparcErrorMixin` (#6764)
GitHK Nov 20, 2024
66a492f
♻️ Fix agent tests (#6772)
giancarloromeo Nov 20, 2024
c38b064
Fixes [unit] webserver 03 and [unit] settings-library (both mypy and …
pcrespov Nov 20, 2024
150b17a
Merge remote-tracking branch 'upstream/master' into update-master-XXXXX
sanderegg Nov 20, 2024
17d1702
Merge pull request #6780 from sanderegg/update-master-XXXXX
sanderegg Nov 20, 2024
47e3570
⬆️Pydantic V2: missing import in director-v0 (#6781)
sanderegg Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
♻️ Greenify pylint (after Pydantic v2 migration) (#6747)
giancarloromeo authored Nov 19, 2024

Verified

This commit was signed with the committer’s verified signature.
jimmykarily Dimitris Karakasilis
commit 3250e5de90b8c6168d4702edeffd8ca278432693
5 changes: 0 additions & 5 deletions packages/aws-library/src/aws_library/s3/_errors.py
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 0 additions & 2 deletions packages/common-library/tests/test_errors_classes.py
Original file line number Diff line number Diff line change
@@ -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"


Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -167,17 +167,13 @@ 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)


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)

Original file line number Diff line number Diff line change
@@ -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}"
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@


class BaseDynamicSchedulerError(OsparcErrorMixin, ValueError):
code = "simcore.service.dynamic.scheduler" # type:ignore[assignment]
...
Original file line number Diff line number Diff line change
@@ -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):
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@


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


class DestinationIsNotADirectoryError(BaseServicesPreferencesError):
Original file line number Diff line number Diff line change
@@ -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."