Skip to content

Commit

Permalink
fix: workflows: multipart.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoytovMA committed Mar 7, 2024
1 parent c24ea32 commit 55da65b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fsconnectors/utils/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def __init__(
self.key = key
self._upload_id = ''
self._part_num = 0
self._part_info = {
'Parts': []
}
self._part_info = dict(Parts=[])

@classmethod
def open(
Expand All @@ -41,7 +39,7 @@ def open(
self._upload_id = resp['UploadId']
return self

def write(self, data: bytes, part_num: Optional[int] = None):
def write(self, data: bytes, part_num: Optional[int] = None) -> None:
if part_num is None:
part_num = self._part_num = self._part_num + 1
elif 1 <= part_num <= 10000:
Expand All @@ -57,7 +55,7 @@ def write(self, data: bytes, part_num: Optional[int] = None):
}
)

def close(self):
def close(self) -> None:
resp = self.client.list_parts(
Bucket=self.bucket,
Key=self.key,
Expand Down Expand Up @@ -108,9 +106,7 @@ def __init__(
self.key = key
self._upload_id = ''
self._part_num = 0
self._part_info = {
'Parts': []
}
self._part_info = dict(Parts=[])

@classmethod
async def open(
Expand All @@ -124,7 +120,7 @@ async def open(
self._upload_id = resp['UploadId']
return self

async def write(self, data: bytes, part_num: Optional[int] = None):
async def write(self, data: bytes, part_num: Optional[int] = None) -> None:
if part_num is None:
part_num = self._part_num = self._part_num + 1
elif 1 <= part_num <= 10000:
Expand All @@ -140,7 +136,7 @@ async def write(self, data: bytes, part_num: Optional[int] = None):
}
)

async def close(self):
async def close(self) -> None:
resp = await self.client.list_parts(
Bucket=self.bucket,
Key=self.key,
Expand Down

0 comments on commit 55da65b

Please sign in to comment.