diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py b/sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py index c179ae057d14..699226165fc1 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_requests_asyncio.py @@ -163,7 +163,7 @@ async def send( # pylint:disable=invalid-overridden-method response = await loop.run_in_executor( None, functools.partial( - self.session.request, + self.session.request, # type: ignore request.method, request.url, headers=request.headers, diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py b/sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py index 0158766868d5..a339c210f8c6 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py @@ -236,7 +236,7 @@ async def send( try: response = await trio.to_thread.run_sync( functools.partial( - self.session.request, + self.session.request, # type: ignore request.method, request.url, headers=request.headers, @@ -254,7 +254,7 @@ async def send( except AttributeError: # trio < 0.12.1 response = await trio.run_sync_in_worker_thread( # type: ignore # pylint:disable=no-member functools.partial( - self.session.request, + self.session.request, # type: ignore request.method, request.url, headers=request.headers, diff --git a/sdk/core/azure-core/azure/core/rest/_http_response_impl.py b/sdk/core/azure-core/azure/core/rest/_http_response_impl.py index 4357f1dedb22..ea72a7662075 100644 --- a/sdk/core/azure-core/azure/core/rest/_http_response_impl.py +++ b/sdk/core/azure-core/azure/core/rest/_http_response_impl.py @@ -182,7 +182,7 @@ class _HttpResponseBaseImpl( :type request: ~azure.core.rest.HttpRequest :keyword any internal_response: The response we get directly from the transport. For example, for our requests transport, this will be a requests.Response. - :keyword optional[int] block_size: The block size we are using in our transport + :keyword Optional[int] block_size: The block size we are using in our transport :keyword int status_code: The status code of the response :keyword str reason: The HTTP reason :keyword str content_type: The content type of the response @@ -264,7 +264,7 @@ def headers(self) -> MutableMapping[str, str]: def content_type(self) -> Optional[str]: """The content type of the response. - :rtype: optional[str] + :rtype: Optional[str] :return: The content type of the response. """ return self._content_type @@ -285,7 +285,7 @@ def encoding(self) -> Optional[str]: :return: The response encoding. We either return the encoding set by the user, or try extracting the encoding from the response's content type. If all fails, we return `None`. - :rtype: optional[str] + :rtype: Optional[str] """ try: return self._encoding @@ -294,10 +294,10 @@ def encoding(self) -> Optional[str]: return self._encoding @encoding.setter - def encoding(self, value: str) -> None: + def encoding(self, value: Optional[str]) -> None: """Sets the response encoding. - :param str value: Sets the response encoding. + :param Optional[str] value: Sets the response encoding. """ self._encoding = value self._text = None # clear text cache @@ -306,7 +306,7 @@ def encoding(self, value: str) -> None: def text(self, encoding: Optional[str] = None) -> str: """Returns the response body as a string - :param optional[str] encoding: The encoding you want to decode the text with. Can + :param Optional[str] encoding: The encoding you want to decode the text with. Can also be set independently through our encoding property :return: The response's content decoded as a string. :rtype: str @@ -374,7 +374,7 @@ class HttpResponseImpl(_HttpResponseBaseImpl, _HttpResponse, HttpResponseBackcom :type request: ~azure.core.rest.HttpRequest :keyword any internal_response: The response we get directly from the transport. For example, for our requests transport, this will be a requests.Response. - :keyword optional[int] block_size: The block size we are using in our transport + :keyword Optional[int] block_size: The block size we are using in our transport :keyword int status_code: The status code of the response :keyword str reason: The HTTP reason :keyword str content_type: The content type of the response diff --git a/sdk/core/corehttp/corehttp/rest/_http_response_impl.py b/sdk/core/corehttp/corehttp/rest/_http_response_impl.py index 34ce58a56dd1..2e22680c6bbc 100644 --- a/sdk/core/corehttp/corehttp/rest/_http_response_impl.py +++ b/sdk/core/corehttp/corehttp/rest/_http_response_impl.py @@ -54,7 +54,7 @@ class _HttpResponseBaseImpl(_HttpResponseBase): # pylint: disable=too-many-inst :type request: ~corehttp.rest.HttpRequest :keyword any internal_response: The response we get directly from the transport. For example, for our requests transport, this will be a requests.Response. - :keyword optional[int] block_size: The block size we are using in our transport + :keyword Optional[int] block_size: The block size we are using in our transport :keyword int status_code: The status code of the response :keyword str reason: The HTTP reason :keyword str content_type: The content type of the response @@ -136,7 +136,7 @@ def headers(self) -> MutableMapping[str, str]: def content_type(self) -> Optional[str]: """The content type of the response. - :rtype: optional[str] + :rtype: Optional[str] :return: The content type of the response. """ return self._content_type @@ -157,7 +157,7 @@ def encoding(self) -> Optional[str]: :return: The response encoding. We either return the encoding set by the user, or try extracting the encoding from the response's content type. If all fails, we return `None`. - :rtype: optional[str] + :rtype: Optional[str] """ try: return self._encoding @@ -166,10 +166,10 @@ def encoding(self) -> Optional[str]: return self._encoding @encoding.setter - def encoding(self, value: str) -> None: + def encoding(self, value: Optional[str]) -> None: """Sets the response encoding. - :param str value: Sets the response encoding. + :param Optional[str] value: Sets the response encoding. """ self._encoding = value self._text = None # clear text cache @@ -178,7 +178,7 @@ def encoding(self, value: str) -> None: def text(self, encoding: Optional[str] = None) -> str: """Returns the response body as a string - :param optional[str] encoding: The encoding you want to decode the text with. Can + :param Optional[str] encoding: The encoding you want to decode the text with. Can also be set independently through our encoding property :return: The response's content decoded as a string. :rtype: str @@ -246,7 +246,7 @@ class HttpResponseImpl(_HttpResponseBaseImpl, _HttpResponse): :type request: ~corehttp.rest.HttpRequest :keyword any internal_response: The response we get directly from the transport. For example, for our requests transport, this will be a requests.Response. - :keyword optional[int] block_size: The block size we are using in our transport + :keyword Optional[int] block_size: The block size we are using in our transport :keyword int status_code: The status code of the response :keyword str reason: The HTTP reason :keyword str content_type: The content type of the response