Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions sdk/core/azure-core/azure/core/rest/_http_response_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions sdk/core/corehttp/corehttp/rest/_http_response_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down