Skip to content

Commit

Permalink
Merge pull request #674 from microsoftgraph/shem/expose_typing_inform…
Browse files Browse the repository at this point in the history
…ation

Expose typing information
  • Loading branch information
shemogumbe authored Aug 29, 2024
2 parents 788bb22 + 2a2427c commit eeb87e8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ push = false

[tool.bumpver.file_patterns]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"src/msgraph_core/_constants.py" = ["{version}"]
"src/msgraph_core/_constants.py" = ["{version}"]

[tool.poetry.packages]
include = ["src/msgraph_core"]
6 changes: 3 additions & 3 deletions src/msgraph_core/models/upload_result.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Optional, TypeVar
from typing import Any, Callable, Dict, List, Optional, TypeVar, Generic

from dataclasses import dataclass
from datetime import datetime
Expand Down Expand Up @@ -50,9 +50,9 @@ def serialize(self, writer: SerializationWriter) -> None:
writer.write_additional_data_value(self.additional_data)


class UploadResult:
class UploadResult(Generic[T]):

def __init__(self):
def __init__(self) -> None:
self.upload_session: Optional[UploadSessionDataHolder] = None
self.item_response: Optional[T] = None
self.location: Optional[str] = None
Expand Down
Empty file added src/msgraph_core/py.typed.txt
Empty file.
2 changes: 1 addition & 1 deletion src/msgraph_core/tasks/large_file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def upload(self, after_chunk_upload: Optional[Callable] = None):
logging.error("Error uploading chunk %s", error)
finally:
self.chunks -= 1
upload_result = UploadResult()
upload_result: UploadResult[Any] = UploadResult()
upload_result.item_response = response
upload_result.location = self.upload_session.upload_url
return upload_result
Expand Down

0 comments on commit eeb87e8

Please sign in to comment.