|
1 | 1 | import os
|
2 |
| -from typing import Callable, Optional, List, Tuple, Any, Dict |
| 2 | +from typing import Callable, Optional, List, Tuple, Any, Dict, Union |
3 | 3 | from io import BytesIO
|
4 | 4 | from asyncio import Future
|
5 | 5 | from datetime import datetime, timedelta, timezone
|
6 | 6 | import logging
|
7 | 7 | import httpx
|
| 8 | +from httpx import Response |
8 | 9 |
|
9 | 10 | from kiota_abstractions.serialization.parsable import Parsable
|
10 | 11 | from kiota_abstractions.method import Method
|
@@ -152,7 +153,10 @@ def next_range(self):
|
152 | 153 | def next_range(self, value: Optional[str]) -> None:
|
153 | 154 | self._next_range = value
|
154 | 155 |
|
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]: |
156 | 160 | upload_url = self.get_validated_upload_url(self.upload_session)
|
157 | 161 | if not upload_url:
|
158 | 162 | raise ValueError('The upload session URL must not be empty.')
|
@@ -200,7 +204,7 @@ async def last_chunk(
|
200 | 204 | range_start: int = 0,
|
201 | 205 | range_end: int = 0,
|
202 | 206 | parsable_factory: Optional[ParsableFactory] = None
|
203 |
| - ) -> Future: |
| 207 | + ) -> Union[Future, Response]: |
204 | 208 | upload_url = self.get_validated_upload_url(self.upload_session)
|
205 | 209 | if not upload_url:
|
206 | 210 | raise ValueError('The upload session URL must not be empty.')
|
|
0 commit comments