@@ -88,6 +88,10 @@ def _request(self, method: str, url: str, **kwargs: Any) -> requests.Response:
8888 return requests .post (url , ** kwargs ) # pylint: disable=missing-timeout
8989 if method_upper == "PUT" :
9090 return requests .put (url , ** kwargs ) # pylint: disable=missing-timeout
91+ if method_upper == "PATCH" :
92+ return requests .patch (url , ** kwargs ) # pylint: disable=missing-timeout
93+ if method_upper == "DELETE" :
94+ return requests .delete (url , ** kwargs ) # pylint: disable=missing-timeout
9195 raise ValueError (f"Unsupported HTTP method for retry wrapper: { method } " )
9296
9397 def __init__ (self , spec : dict ):
@@ -230,7 +234,8 @@ def handle_post_copy_action(self, files: dict) -> int:
230234 if not file_url :
231235 self .logger .error (f"Failed to get file URL for { file_path } " )
232236 return 1
233- response = requests .delete (
237+ response = self ._request (
238+ "DELETE" ,
234239 file_url ,
235240 headers = {
236241 "Authorization" : "Bearer " + self .credentials ["access_token" ],
@@ -284,7 +289,8 @@ def handle_post_copy_action(self, files: dict) -> int:
284289 "Authorization" : "Bearer " + self .credentials ["access_token" ],
285290 "Content-Type" : "application/json" ,
286291 }
287- response = requests .patch (
292+ response = self ._request (
293+ "PATCH" ,
288294 file_url ,
289295 headers = patch_headers ,
290296 timeout = self .timeout ,
@@ -303,7 +309,8 @@ def handle_post_copy_action(self, files: dict) -> int:
303309 f"Failed to get file URL for { destination_path } /{ new_file } "
304310 )
305311 return 1
306- response = requests .delete (
312+ response = self ._request (
313+ "DELETE" ,
307314 conflict_url ,
308315 headers = {
309316 "Authorization" : (
@@ -321,7 +328,8 @@ def handle_post_copy_action(self, files: dict) -> int:
321328 self .logger .error (response .json ())
322329 return 1
323330
324- response = requests .patch (
331+ response = self ._request (
332+ "PATCH" ,
325333 file_url ,
326334 headers = patch_headers ,
327335 timeout = self .timeout ,
@@ -540,7 +548,8 @@ def push_files_from_worker(
540548 retry_delay = 1
541549
542550 for attempt in range (max_retries ):
543- response = requests .put (
551+ response = self ._request (
552+ "PUT" ,
544553 upload_url ,
545554 headers = {
546555 "Authorization" : (
0 commit comments