From 7050ff654d83d000e384b889c0e28bb0e877a018 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Thu, 10 Aug 2023 14:00:06 -0500 Subject: [PATCH] Deprecating some RequestClient subclasses. Deprecating to help move away from service-specific types in a general library. --- .../lib/communication/dmod/communication/client.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/lib/communication/dmod/communication/client.py b/python/lib/communication/dmod/communication/client.py index dba8a20ed..19ea72980 100644 --- a/python/lib/communication/dmod/communication/client.py +++ b/python/lib/communication/dmod/communication/client.py @@ -5,6 +5,7 @@ import typing from abc import ABC, abstractmethod from asyncio import AbstractEventLoop +from deprecated import deprecated from pathlib import Path from typing import Generic, Optional, Type, TypeVar, Union @@ -12,10 +13,9 @@ from .maas_request import ExternalRequest, ExternalRequestResponse from .message import AbstractInitRequest, Response -from .partition_request import PartitionRequest, PartitionResponse -from .dataset_management_message import DatasetManagementMessage, DatasetManagementResponse -from .scheduler_request import SchedulerRequestMessage, SchedulerRequestResponse -from .evaluation_request import EvaluationConnectionRequest +from .partition_request import PartitionResponse +from .dataset_management_message import DatasetManagementResponse +from .scheduler_request import SchedulerRequestResponse from .evaluation_request import EvaluationConnectionRequestResponse from .update_message import UpdateMessage, UpdateMessageResponse @@ -837,6 +837,7 @@ async def listen(self) -> typing.Union[str, bytes]: return await websocket.connection.recv() +@deprecated("Use RequestClient or ExternalRequestClient instead") class SchedulerClient(RequestClient): def __init__(self, *args, **kwargs): @@ -948,6 +949,7 @@ def warnings(self): return self._warnings +@deprecated("Use RequestClient or ExternalRequestClient instead") class DataServiceClient(RequestClient): """ Client for data service communication between internal DMOD services. @@ -957,6 +959,7 @@ def __init__(self, *args, **kwargs): super().__init__(default_response_type=DatasetManagementResponse, *args, **kwargs) +@deprecated("Use RequestClient or ExternalRequestClient instead") class PartitionerServiceClient(RequestClient): """ A client for interacting with the partitioner service. @@ -969,6 +972,7 @@ def __init__(self, *args, **kwargs): super().__init__(default_response_type=PartitionResponse, *args, **kwargs) +@deprecated("Use RequestClient or ExternalRequestClient instead") class EvaluationServiceClient(RequestClient): """ A client for interacting with the evaluation service