Skip to content

Commit d025c1e

Browse files
committed
worksheet range fix
1 parent 5985120 commit d025c1e

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

examples/onedrive/excel/read_range.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
import sys
88

99
from office365.graph_client import GraphClient
10-
from tests.graph_case import acquire_token_by_username_password
10+
from tests import test_client_id, test_password, test_tenant, test_username
1111

12-
client = GraphClient(acquire_token_by_username_password)
12+
client = GraphClient.with_username_and_password(
13+
test_tenant, test_client_id, test_username, test_password
14+
)
1315
drive_item = client.me.drive.root.get_by_path("Financial Sample.xlsx")
1416
worksheets = drive_item.workbook.worksheets.get().execute_query()
1517
if len(worksheets) == 0:
1618
sys.exit("No worksheets found")
1719

1820
# worksheet_range = worksheets["Sheet1"].range().execute_query()
19-
worksheet_range = worksheets["Sheet1"].range(address="A2:P10").execute_query()
20-
print(worksheet_range)
21+
worksheet_range = worksheets["Sheet1"].range(address="A1:B3").execute_query()
22+
print(worksheet_range.values)

generator/metadata/MicrosoftGraph.xml

+4
Original file line numberDiff line numberDiff line change
@@ -6134,6 +6134,9 @@
61346134
<Annotations Target="microsoft.graph.educationSubmission/unsubmittedDateTime">
61356135
<Annotation Term="Org.OData.Core.V1.Computed" Bool="true"/>
61366136
</Annotations>
6137+
<Annotations Target="microsoft.graph.educationSubmission/webUrl">
6138+
<Annotation Term="Org.OData.Core.V1.Computed" Bool="true"/>
6139+
</Annotations>
61376140
<Annotations Target="microsoft.graph.subscription">
61386141
<Annotation Term="Org.OData.Capabilities.V1.CountRestrictions">
61396142
<Record>
@@ -24575,6 +24578,7 @@
2457524578
<Property Name="submittedDateTime" Type="Edm.DateTimeOffset"/>
2457624579
<Property Name="unsubmittedBy" Type="graph.identitySet"/>
2457724580
<Property Name="unsubmittedDateTime" Type="Edm.DateTimeOffset"/>
24581+
<Property Name="webUrl" Type="Edm.String"/>
2457824582
<NavigationProperty Name="outcomes" Type="Collection(graph.educationOutcome)" ContainsTarget="true"/>
2457924583
<NavigationProperty Name="resources" Type="Collection(graph.educationSubmissionResource)" ContainsTarget="true"/>
2458024584
<NavigationProperty Name="submittedResources" Type="Collection(graph.educationSubmissionResource)" ContainsTarget="true"/>

office365/runtime/client_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, context, resource_path=None, parent_collection=None):
3434
self._entity_type_name = None
3535
self._resource_path = resource_path
3636

37-
def clear(self):
37+
def clear_state(self):
3838
# type: () -> Self
3939
"""Resets client object's state."""
4040
self._properties = {

office365/runtime/client_object_collection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, context, item_type, resource_path=None, parent=None):
2525
self._next_request_url = None
2626
self._parent = parent
2727

28-
def clear(self):
28+
def clear_state(self):
2929
"""Clears client object collection"""
3030
if not self._paged_mode:
3131
self._data = []

office365/runtime/odata/request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def process_response(self, response, query):
5454
return
5555

5656
if isinstance(return_type, ClientObject):
57-
return_type.clear()
57+
return_type.clear_state()
5858

5959
if (
6060
response.headers.get("Content-Type", "").lower().split(";")[0]

0 commit comments

Comments
 (0)