Skip to content

Commit 94124e4

Browse files
committed
clean up code
1 parent 743003c commit 94124e4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/msgraph_core/tasks/large_file_upload.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import os
2-
from typing import Callable, Optional, List, Tuple, Any, Dict
2+
from typing import Callable, Optional, List, Tuple, Any, Dict, Union
33
from io import BytesIO
44
from asyncio import Future
55
from datetime import datetime, timedelta, timezone
66
import logging
77
import httpx
8+
from httpx import Response
89

910
from kiota_abstractions.serialization.parsable import Parsable
1011
from kiota_abstractions.method import Method
@@ -152,7 +153,10 @@ def next_range(self):
152153
def next_range(self, value: Optional[str]) -> None:
153154
self._next_range = value
154155

155-
async def next_chunk(self, file: BytesIO, range_start: int = 0, range_end: int = 0) -> Future:
156+
async def next_chunk(self,
157+
file: BytesIO,
158+
range_start: int = 0,
159+
range_end: int = 0) -> Union[Future, Response]:
156160
upload_url = self.get_validated_upload_url(self.upload_session)
157161
if not upload_url:
158162
raise ValueError('The upload session URL must not be empty.')
@@ -200,7 +204,7 @@ async def last_chunk(
200204
range_start: int = 0,
201205
range_end: int = 0,
202206
parsable_factory: Optional[ParsableFactory] = None
203-
) -> Future:
207+
) -> Union[Future, Response]:
204208
upload_url = self.get_validated_upload_url(self.upload_session)
205209
if not upload_url:
206210
raise ValueError('The upload session URL must not be empty.')

0 commit comments

Comments
 (0)