From 4698edcde3788444ef41a82f4a73a5c64bb4bd29 Mon Sep 17 00:00:00 2001 From: Sankalp Sanand Date: Thu, 23 Nov 2023 08:19:20 -0500 Subject: [PATCH] running precommit hooks --- covalent/executor/qbase.py | 1 + covalent/quantum/qcluster/base.py | 1 + covalent_ui/api/v1/models/dispatch_model.py | 54 +++++++++++---------- covalent_ui/api/v1/models/logs_model.py | 24 ++++----- 4 files changed, 44 insertions(+), 36 deletions(-) diff --git a/covalent/executor/qbase.py b/covalent/executor/qbase.py index ecf1e855f..cc3e55144 100644 --- a/covalent/executor/qbase.py +++ b/covalent/executor/qbase.py @@ -113,6 +113,7 @@ def override_shots(self) -> Union[int, None]: # User has specified `shots` as an int. return self.shots + model_config = ConfigDict(extra="allow") @model_validator(mode="before") diff --git a/covalent/quantum/qcluster/base.py b/covalent/quantum/qcluster/base.py index cee572c08..9f2be2427 100644 --- a/covalent/quantum/qcluster/base.py +++ b/covalent/quantum/qcluster/base.py @@ -95,4 +95,5 @@ def selector_function(self, qscript, executors): Implement selection logic here. """ raise NotImplementedError + model_config = ConfigDict(extra="allow") diff --git a/covalent_ui/api/v1/models/dispatch_model.py b/covalent_ui/api/v1/models/dispatch_model.py index fcd2090e2..27b7c91f5 100644 --- a/covalent_ui/api/v1/models/dispatch_model.py +++ b/covalent_ui/api/v1/models/dispatch_model.py @@ -59,21 +59,23 @@ class DispatchResponse(BaseModel): items: List[DispatchModule] total_count: int - model_config = ConfigDict(json_schema_extra={ - "example": { - "dispatches": [ - { - "dispatch_id": "1b44989a-1c65-4148-959e-00062a34ac16", - "lattice_name": "testing content", - "runtime": 1, - "started_time": "2022-06-13T07:45:02.114328+00:00", - "end_time": "2022-06-13T07:45:02.216474+00:00", - "status": "COMPLETED", - } - ], - "total_count": 10, + model_config = ConfigDict( + json_schema_extra={ + "example": { + "dispatches": [ + { + "dispatch_id": "1b44989a-1c65-4148-959e-00062a34ac16", + "lattice_name": "testing content", + "runtime": 1, + "started_time": "2022-06-13T07:45:02.114328+00:00", + "end_time": "2022-06-13T07:45:02.216474+00:00", + "status": "COMPLETED", + } + ], + "total_count": 10, + } } - }) + ) class DeleteDispatchesRequest(BaseModel): @@ -108,15 +110,17 @@ class DispatchDashBoardResponse(BaseModel): total_jobs_new_object: Union[int, None] = None latest_running_task_status: Union[Status, None] = None total_dispatcher_duration: Union[int, None] = None - model_config = ConfigDict(json_schema_extra={ - "example": { - "total_jobs": 5, - "total_jobs_running": 5, - "total_jobs_completed": 20, - "total_jobs_failed": 3, - "total_jobs_cancelled": 0, - "total_jobs_new_object": 1, - "latest_running_task_status": "COMPLETED", - "total_dispatcher_duration": 90, + model_config = ConfigDict( + json_schema_extra={ + "example": { + "total_jobs": 5, + "total_jobs_running": 5, + "total_jobs_completed": 20, + "total_jobs_failed": 3, + "total_jobs_cancelled": 0, + "total_jobs_new_object": 1, + "latest_running_task_status": "COMPLETED", + "total_dispatcher_duration": 90, + } } - }) + ) diff --git a/covalent_ui/api/v1/models/logs_model.py b/covalent_ui/api/v1/models/logs_model.py index 9acb6d538..a8a356100 100644 --- a/covalent_ui/api/v1/models/logs_model.py +++ b/covalent_ui/api/v1/models/logs_model.py @@ -55,15 +55,17 @@ class LogsResponse(BaseModel): items: List[LogsModule] total_count: Union[int, None] = None - model_config = ConfigDict(json_schema_extra={ - "example": { - "data": [ - { - "log_date": "2022-06-13T07:45:02.114328+00:00", - "status": "INFO", - "message": "Application Started", - } - ], - "total_count": 1, + model_config = ConfigDict( + json_schema_extra={ + "example": { + "data": [ + { + "log_date": "2022-06-13T07:45:02.114328+00:00", + "status": "INFO", + "message": "Application Started", + } + ], + "total_count": 1, + } } - }) + )