Skip to content

Commit 0d5d0d7

Browse files
authored
Merge branch 'main' into shem/large_file_upload
2 parents b506460 + ca7775b commit 0d5d0d7

File tree

8 files changed

+87
-116
lines changed

8 files changed

+87
-116
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Build package
3333
run: python -m build
3434
- name: Publish package
35-
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
35+
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
3636
with:
3737
user: __token__
3838
password: ${{ secrets.PYPI_TOKEN }}

requirements-dev.txt

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
-i https://pypi.org/simple
22

3-
astroid==3.0.2 ; python_full_version >= '3.7.2'
3+
astroid==3.1.0 ; python_full_version >= '3.7.2'
44

55
async-generator==1.10 ; python_version >= '3.5'
66

77
asyncmock==0.4.2
88

99
attrs==23.2.0 ; python_version >= '3.7'
1010

11-
azure-core==1.29.7 ; python_version >= '3.7'
11+
azure-core==1.30.1 ; python_version >= '3.7'
1212

13-
azure-identity==1.15.0
13+
azure-identity==1.16.0
1414

15-
build==1.0.3
15+
build==1.2.1
1616

1717
bumpver==2023.1129
1818

19-
certifi==2023.11.17 ; python_version >= '3.6'
19+
certifi==2024.2.2 ; python_version >= '3.6'
2020

2121
cffi==1.16.0 ; os_name == 'nt' and implementation_name != 'pypy'
2222

@@ -26,15 +26,15 @@ click==8.1.7 ; python_version >= '3.6'
2626

2727
colorama==0.4.6 ; os_name == 'nt'
2828

29-
coverage[toml]==7.4.1 ; python_version >= '3.7'
29+
coverage[toml]==7.4.4 ; python_version >= '3.7'
3030

31-
cryptography==42.0.1 ; python_version >= '3.7'
31+
cryptography==42.0.5 ; python_version >= '3.7'
3232

3333
dill==0.3.6 ; python_version < '3.11'
3434

3535
exceptiongroup==1.1.1 ; python_version < '3.11'
3636

37-
idna==3.6 ; python_version >= '3.5'
37+
idna==3.7 ; python_version >= '3.5'
3838

3939
importlib-metadata==6.8.0 ; python_version >= '3.7'
4040

@@ -52,39 +52,39 @@ mccabe==0.7.0 ; python_version >= '3.6'
5252

5353
mock==5.1.0 ; python_version >= '3.6'
5454

55-
msal==1.26.0
55+
msal==1.28.0
5656

5757
msal-extensions==1.1.0
5858

59-
mypy==1.8.0
59+
mypy==1.9.0
6060

6161
mypy-extensions==1.0.0 ; python_version >= '3.5'
6262

6363
outcome==1.3.0.post0 ; python_version >= '3.7'
6464

65-
packaging==23.2 ; python_version >= '3.7'
65+
packaging==24.0 ; python_version >= '3.7'
6666

6767
pathlib2==2.3.7.post1
6868

69-
platformdirs==4.1.0 ; python_version >= '3.7'
69+
platformdirs==4.2.0 ; python_version >= '3.7'
7070

7171
pluggy==1.4.0 ; python_version >= '3.7'
7272

7373
portalocker==2.8.2 ; python_version >= '3.5' and platform_system == 'Windows'
7474

75-
pycparser==2.21
75+
pycparser==2.22
7676

7777
pyjwt[crypto]==2.8.0 ; python_version >= '3.7'
7878

79-
pylint==3.0.3
79+
pylint==3.1.0
8080

8181
pyproject-hooks==1.0.0 ; python_version >= '3.7'
8282

83-
pytest==8.0.0
83+
pytest==8.1.1
8484

8585
pytest-cov==4.1.0
8686

87-
pytest-mock==3.12.0
87+
pytest-mock==3.14.0
8888

8989
python-dotenv==1.0.1
9090

@@ -94,39 +94,40 @@ pywin32==306 ; platform_system == 'Windows'
9494

9595
requests==2.31.0 ; python_version >= '3.7'
9696

97-
setuptools==69.0.3
97+
setuptools==69.5.1
9898

9999
six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
100100

101-
sniffio==1.3.0 ; python_version >= '3.7'
101+
sniffio==1.3.1 ; python_version >= '3.7'
102102

103103
sortedcontainers==2.4.0
104104

105105
toml==0.10.2
106106

107107
tomli==2.0.1 ; python_version < '3.11'
108108

109-
tomlkit==0.12.3 ; python_version >= '3.7'
109+
tomlkit==0.12.4 ; python_version >= '3.7'
110110

111-
trio==0.24.0
111+
trio==0.25.0
112112

113-
types-python-dateutil==2.8.19.20240106
113+
types-python-dateutil==2.9.0.20240316
114114

115-
typing-extensions==4.9.0 ; python_version >= '3.7'
115+
types-requests==2.31.0.20240406; python_version >= '3.7'
116+
urllib3==2.2.1 ; python_version >= '3.7'
117+
typing-extensions==4.11.0 ; python_version >= '3.7'
116118

117-
urllib3==2.1.0 ; python_version >= '3.7'
118119

119120
wrapt==1.15.0 ; python_version < '3.11'
120121

121122
yapf==0.40.2
122123

123-
zipp==3.17.0 ; python_version >= '3.7'
124+
zipp==3.18.1 ; python_version >= '3.7'
124125

125-
aiohttp==3.9.3 ; python_version >= '3.6'
126+
aiohttp==3.9.5 ; python_version >= '3.6'
126127

127128
aiosignal==1.3.1 ; python_version >= '3.7'
128129

129-
anyio==4.2.0 ; python_version >= '3.7'
130+
anyio==4.3.0 ; python_version >= '3.7'
130131

131132
async-timeout==4.0.3 ; python_version >= '3.6'
132133

@@ -138,19 +139,19 @@ h2==4.1.0
138139

139140
hpack==4.0.0 ; python_full_version >= '3.6.1'
140141

141-
httpcore==1.0.2 ; python_version >= '3.7'
142+
httpcore==1.0.5 ; python_version >= '3.7'
142143

143-
httpx[http2]==0.26.0
144+
httpx[http2]==0.27.0
144145

145146
hyperframe==6.0.1 ; python_full_version >= '3.6.1'
146147

147-
microsoft-kiota-abstractions==1.1.0
148+
microsoft-kiota-abstractions==1.3.2
148149

149150
microsoft-kiota-authentication-azure==1.0.0
150151

151-
microsoft-kiota-http==1.2.1
152+
microsoft-kiota-http==1.3.1
152153

153-
multidict==6.0.4 ; python_version >= '3.7'
154+
multidict==6.0.5 ; python_version >= '3.7'
154155

155156
uritemplate==4.1.1 ; python_version >= '3.6'
156157

src/msgraph_core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
from .base_graph_request_adapter import BaseGraphRequestAdapter
1515
from .graph_client_factory import GraphClientFactory
1616
from .tasks import PageIterator
17+
from .models import PageResult
1718

1819
__version__ = SDK_VERSION

src/msgraph_core/base_graph_request_adapter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import httpx
2-
from kiota_abstractions.authentication import AuthenticationProvider # type: ignore
2+
from kiota_abstractions.authentication import AuthenticationProvider
33
from kiota_abstractions.serialization import (
44
ParseNodeFactory,
55
ParseNodeFactoryRegistry,
66
SerializationWriterFactory,
77
SerializationWriterFactoryRegistry,
8-
) # type: ignore
9-
from kiota_http.httpx_request_adapter import HttpxRequestAdapter # type: ignore
8+
)
9+
from kiota_http.httpx_request_adapter import HttpxRequestAdapter
1010

1111
from .graph_client_factory import GraphClientFactory
1212

src/msgraph_core/models/page_result.py

Lines changed: 27 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,83 +10,54 @@
1010
PageResult: Represents a page of items in a paged response.
1111
"""
1212
from __future__ import annotations
13-
from typing import Any, List, Optional
13+
from typing import List, Any, Optional, Dict, Callable
1414
from dataclasses import dataclass
1515

16-
from kiota_abstractions.serialization.parsable import Parsable # type: ignore
16+
from kiota_abstractions.serialization.parsable import Parsable
1717
from kiota_abstractions.serialization.serialization_writer \
18-
import SerializationWriter # type: ignore
19-
from kiota_abstractions.serialization.parse_node import ParseNode # type: ignore
20-
from typing import TypeVar, List, Optional, Generic
18+
import SerializationWriter
19+
from kiota_abstractions.serialization.parse_node import ParseNode
20+
from typing import TypeVar, List, Optional
2121

2222
T = TypeVar('T')
2323

2424

2525
@dataclass
26-
class PageResult(Parsable, Generic[T]):
27-
"""
28-
Represents a page of items in a paged response.
29-
"""
30-
object_type: Optional[Any] = None
26+
class PageResult(Parsable):
3127
odata_next_link: Optional[str] = None
32-
value: Optional[List[T]] = None
28+
value: Optional[List[Parsable]] = None
3329

3430
@staticmethod
35-
def create_from_discriminator_value(parse_node: ParseNode) -> PageResult: # pylint: disable=unused-argument
31+
def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> PageResult:
3632
"""
37-
Creates a PageResult from a discriminator value.
38-
Returns:
39-
PageResult: The created PageResult.
33+
Creates a new instance of the appropriate class based on discriminator value
34+
Args:
35+
parseNode: The parse node to use to read the discriminator value and create the object
36+
Returns: Attachment
4037
"""
41-
impprt_statement = f"from msgraph.generated.models.{str(PageResult.object_type).lower()} \
42-
import {PageResult.object_type}"
43-
44-
# pylint: disable=exec-used
45-
exec(impprt_statement)
46-
if isinstance(PageResult.object_type, str):
47-
return PageResult(locals()[PageResult.object_type])
38+
if not parse_node:
39+
raise TypeError("parse_node cannot be null")
4840
return PageResult()
4941

50-
def set_value(self, value: List[Any]):
51-
"""
52-
Sets the items in the page.
53-
54-
Args:
55-
value (List[Any]): The items to set.
56-
"""
57-
self.value = value
42+
def get_field_deserializers(self) -> Dict[str, Callable[[ParseNode], None]]:
43+
"""Gets the deserialization information for this object.
5844
59-
def get_field_deserializers(self):
60-
"""
61-
Gets the field deserializers for the PageResult.
6245
Returns:
63-
Dict[str, Callable]: The field deserializers.
46+
Dict[str, Callable[[ParseNode], None]]: The deserialization information for this
47+
object where each entry is a property key with its deserialization callback.
6448
"""
65-
class_name = PageResult.object_type
66-
# pylint: disable=not-callable
67-
instance = class_name()
68-
module_path = instance.__class__.__module__
69-
class_name = instance.__class__.__name__
70-
import_statement = f'from {module_path} import {class_name}'
71-
# pylint: disable=exec-used
72-
exec(import_statement)
73-
serialization_model = locals()[class_name]
7449
return {
75-
'@odata.nextLink':
76-
lambda parse_node: setattr(self, 'odata_next_link', parse_node.get_str_value()),
77-
'odata.deltaLink':
78-
lambda parse_node: setattr(self, 'odata_delta_link', parse_node.get_str_value()),
79-
'value':
80-
lambda parse_node: self.
81-
set_value(parse_node.get_collection_of_object_values(serialization_model))
50+
"@odata.nextLink": lambda x: setattr(self, "odata_next_link", x.get_str_value()),
51+
"value": lambda x: setattr(self, "value", x.get_collection_of_object_values(Parsable))
8252
}
8353

8454
def serialize(self, writer: SerializationWriter) -> None:
85-
"""
86-
Serializes the PageResult into a SerializationWriter.
55+
"""Writes the objects properties to the current writer.
56+
8757
Args:
88-
writer (SerializationWriter): The writer to serialize into.
58+
writer (SerializationWriter): The writer to write to.
8959
"""
90-
writer.write_str_value('@odata.nextLink', self.odata_next_link, self.value)
91-
if self.value is not None:
92-
writer.write_collection_of_object_values(None, list(self.value))
60+
if not writer:
61+
raise TypeError("Writer cannot be null")
62+
writer.write_str_value("@odata.nextLink", self.odata_next_link)
63+
writer.write_collection_of_object_values("value", self.value)

0 commit comments

Comments
 (0)