Skip to content

Commit e04db72

Browse files
author
George Garber
committed
fix batch creation
1 parent 5b7a40b commit e04db72

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/msgraph_core/requests/batch_request_content_collection.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,16 @@ def new_batch_with_failed_requests(self) -> Optional[BatchRequestContent]:
4949
Optional[BatchRequestContent]: A new batch with failed requests.
5050
"""
5151
# Use IDs to get response status codes, generate new batch with failed requests
52-
batch_with_failed_responses: Optional[BatchRequestContent] = (
53-
BatchRequestContent()
54-
)
52+
batch_with_failed_responses: Optional[BatchRequestContent] = BatchRequestContent()
5553
for batch in self.batches:
5654
for request in batch.requests:
57-
if (
58-
request.status_code
59-
not in [ # type: ignore # Method should be deprecated
60-
200,
61-
201,
62-
202,
63-
203,
64-
204,
65-
205,
66-
206,
67-
207,
68-
208,
69-
226,
70-
]
71-
):
55+
if request.status_code not in [ # type: ignore # Method should be deprecated
56+
200, 201, 202, 203, 204, 205, 206, 207, 208, 226
57+
]:
7258
if batch_with_failed_responses is not None:
7359
batch_with_failed_responses.add_request(
7460
request.id, # type: ignore # Bug. Method should be deprecated
75-
request, # type: ignore
61+
request # type: ignore
7662
)
7763
else:
7864
raise ValueError("batch_with_failed_responses is None")

0 commit comments

Comments
 (0)