diff --git a/changes/1801.doc.md b/changes/1801.doc.md new file mode 100644 index 0000000000..51edbbf092 --- /dev/null +++ b/changes/1801.doc.md @@ -0,0 +1 @@ +Update docstrings in `ai.backend.client.request.Request:fetch()` and `ai.backend.client.request.FetchContextManager` as the support for synchronous context manager has been deprecated. diff --git a/src/ai/backend/client/request.py b/src/ai/backend/client/request.py index d3172441bc..6ce893bd44 100644 --- a/src/ai/backend/client/request.py +++ b/src/ai/backend/client/request.py @@ -296,18 +296,8 @@ def fetch(self, **kwargs) -> FetchContextManager: """ Sends the request to the server and reads the response. - You may use this method either with plain synchronous Session or - AsyncSession. Both the followings patterns are valid: - - .. code-block:: python3 - - from ai.backend.client.request import Request - from ai.backend.client.session import Session - - with Session() as sess: - rqst = Request('GET', ...) - with rqst.fetch() as resp: - print(resp.text()) + You may use this method with AsyncSession only, + following the pattern below: .. code-block:: python3 @@ -538,7 +528,7 @@ class FetchContextManager: """ The context manager returned by :func:`Request.fetch`. - It provides both synchronous and asynchronous context manager interfaces. + It provides asynchronous context manager interfaces only. """ __slots__ = (