You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can retrieve the list, and I can update items individualy, but the batch update fails.
Traceback (most recent call last):
File "C:/projects/sharepoint API/Sharepoint API test.py", line 25, in <module>
ctx.execute_batch()
File "c:\repos\dev\office365-rest-python-client\office365\sharepoint\client_context.py", line 108, in execute_batch
batch_request.execute_query()
File "c:\repos\dev\office365-rest-python-client\office365\runtime\client_request.py", line 83, in execute_query
self.process_response(response)
File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 33, in process_response
for response_info in self._read_response(response):
File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 55, in _read_response
yield self._deserialize_response(raw_response)
File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 99, in _deserialize_response
raise ValueError(response)
ValueError: HTTP/1.1 400 Bad Request
CONTENT-TYPE: application/xml;charset=utf-8
<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, Microsoft.SharePoint.Client.InvalidClientQueryException</m:code><m:message xml:lang="en-US">Invalid request.</m:message></m:error>
The text was updated successfully, but these errors were encountered:
the error most likely occurs when batch request is large enough and exceeds a certain boundary, according to List and library limits :
In the latest version (2.3.5 at the moment) the support for batch requests has been improved in terms of introducing items_per_bulk parameter:
ClientContext.execute_batch(items_per_bulk=100)
which allows to control the max amount of operations per batch request (100 by default)
In case batch request exceeds this value, it is getting splitted into a smaller chunks before submitting to the server.
I am using the script from the examples, adding my own site.
https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/sharepoint/lists_and_items/update_items_batch.py
I can retrieve the list, and I can update items individualy, but the batch update fails.
The text was updated successfully, but these errors were encountered: