From 0aef3c1cb8742cf0871502c1096849e1adf4a09f Mon Sep 17 00:00:00 2001 From: ShoytovMA Date: Thu, 7 Mar 2024 11:04:35 +0300 Subject: [PATCH] fix: workflows: asyncio --- fsconnectors/asyncio/connector.py | 4 ++-- fsconnectors/asyncio/local.py | 4 ++-- fsconnectors/asyncio/s3.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fsconnectors/asyncio/connector.py b/fsconnectors/asyncio/connector.py index 7aa6e8a..da9d6a2 100644 --- a/fsconnectors/asyncio/connector.py +++ b/fsconnectors/asyncio/connector.py @@ -1,6 +1,6 @@ -from typing import List, Any from abc import ABC, abstractmethod from contextlib import asynccontextmanager +from typing import List, Any, AsyncGenerator from fsconnectors.utils.entry import FSEntry @@ -11,7 +11,7 @@ class AsyncConnector(ABC): @classmethod @abstractmethod @asynccontextmanager - async def connect(cls, *args, **kwargs) -> 'AsyncConnector': + async def connect(cls, *args, **kwargs) -> AsyncGenerator['AsyncConnector', None]: """Connects to file system. Yields diff --git a/fsconnectors/asyncio/local.py b/fsconnectors/asyncio/local.py index fa2cd22..145eaa5 100644 --- a/fsconnectors/asyncio/local.py +++ b/fsconnectors/asyncio/local.py @@ -3,8 +3,8 @@ import aiofiles import aioshutil import aiofiles.os -from typing import List, Any from contextlib import asynccontextmanager +from typing import List, Any, AsyncGenerator from fsconnectors.utils.entry import FSEntry from fsconnectors.asyncio.connector import AsyncConnector @@ -15,7 +15,7 @@ class AsyncLocalConnector(AsyncConnector): @classmethod @asynccontextmanager - async def connect(cls) -> 'AsyncLocalConnector': + async def connect(cls) -> AsyncGenerator['AsyncLocalConnector', None]: """Connects to file system. Yields diff --git a/fsconnectors/asyncio/s3.py b/fsconnectors/asyncio/s3.py index 522e433..863ce59 100644 --- a/fsconnectors/asyncio/s3.py +++ b/fsconnectors/asyncio/s3.py @@ -1,8 +1,8 @@ import yaml import aioboto3 import aiofiles.tempfile -from typing import List, Any, Literal from contextlib import asynccontextmanager +from typing import List, Any, AsyncGenerator from fsconnectors.utils.entry import FSEntry from fsconnectors.utils.multipart import AsyncMultipartWriter @@ -19,7 +19,7 @@ async def connect( endpoint_url: str, aws_access_key_id: str, aws_secret_access_key: str - ) -> 'AsyncS3Connector': + ) -> AsyncGenerator['AsyncS3Connector', None]: """Connects to file system. Parameters