|
26 | 26 | from .encryption_util import EncryptionMetadata, SnowflakeEncryptionUtil |
27 | 27 | from .errors import RequestExceedMaxRetryError |
28 | 28 | from .file_util import SnowflakeFileUtil |
29 | | -from .http_interceptor import HttpInterceptor, InterceptOnMixin, RequestDTO |
| 29 | +from .http_interceptor import HttpInterceptor, InterceptOnMixin |
30 | 30 | from .vendored import requests |
31 | 31 | from .vendored.requests import ConnectionError, Timeout |
32 | 32 | from .vendored.urllib3 import HTTPResponse |
@@ -314,39 +314,15 @@ def _send_request_with_retry( |
314 | 314 |
|
315 | 315 | if self.retry_count[retry_id] < self.max_retry: |
316 | 316 | url, rest_kwargs = get_request_args() |
317 | | - headers = rest_kwargs.get("headers") |
318 | | - |
319 | | - request_info = RequestDTO(url=url, method=rest_call, headers=headers) |
320 | | - self._intercept_on( |
321 | | - HttpInterceptor.InterceptionHook.ONCE_BEFORE_REQUEST, request_info |
322 | | - ) |
323 | | - |
324 | 317 | request_args_generator = generate_values_from_beginning( |
325 | 318 | url, rest_kwargs, original_function=get_request_args |
326 | 319 | ) |
327 | 320 |
|
328 | | - # ...TODO |
329 | | - # TODO: this url is wrong |
330 | | - # request = RequestDTO(url=url, method=rest_call, headers=rest_kwargs.get('headers') |
331 | | - # self._intercept_on(HttpInterceptor.InterceptionHook.ONCE_BEFORE_REQUEST, request) |
332 | | - # ... |
333 | | - |
334 | | - # TODO: here add |
335 | 321 | while self.retry_count[retry_id] < self.max_retry: |
336 | | - # |
337 | | - # if self.retry_count[retry_id] == 0: |
338 | | - # url, rest_kwargs = get_request_args() |
339 | | - |
340 | 322 | logger.debug(f"retry #{self.retry_count[retry_id]}") |
341 | 323 | cur_timestamp = self.credentials.timestamp |
342 | 324 | url, rest_kwargs = next(request_args_generator) |
343 | 325 |
|
344 | | - headers = rest_kwargs.get("headers") |
345 | | - request_info = RequestDTO(url=url, method=verb, headers=headers) |
346 | | - self._intercept_on( |
347 | | - HttpInterceptor.InterceptionHook.BEFORE_EACH_RETRY, request_info |
348 | | - ) |
349 | | - |
350 | 326 | rest_kwargs["timeout"] = (REQUEST_CONNECTION_TIMEOUT, REQUEST_READ_TIMEOUT) |
351 | 327 | try: |
352 | 328 | if conn: |
|
0 commit comments