Skip to content

Commit

Permalink
Add pylint disable for "unsubscriptable-object" (#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc authored Sep 10, 2024
1 parent 2005007 commit 2ef47f9
Show file tree
Hide file tree
Showing 769 changed files with 7,200 additions and 7,184 deletions.
7 changes: 7 additions & 0 deletions .chronus/changes/fix-pylint-2024-2024-8-10-15-41-17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-python"
---

Add pylint disable for "unsubscriptable-object"
7 changes: 7 additions & 0 deletions .chronus/changes/fix-pylint-2024-2024-8-10-16-19-28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@autorest/python"
---

Add pylint disable for "unsubscriptable-object"
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -101,7 +101,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -142,7 +142,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -121,7 +121,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -162,7 +162,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -101,7 +101,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -142,7 +142,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -121,7 +121,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -162,7 +162,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PollingPagingExampleOperationsMixin(PollingPagingExampleMixinABC):
def _basic_polling_initial(
self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any
) -> Iterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -298,7 +298,7 @@ def basic_paging(self, **kwargs: Any) -> Iterable[JSON]:

cls: ClsType[JSON] = kwargs.pop("cls", None)

error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PollingPagingExampleOperationsMixin(PollingPagingExampleMixinABC):
async def _basic_polling_initial(
self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -273,7 +273,7 @@ def basic_paging(self, **kwargs: Any) -> AsyncIterable[JSON]:

cls: ClsType[JSON] = kwargs.pop("cls", None)

error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def head200(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -99,7 +99,7 @@ async def head204(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -141,7 +141,7 @@ async def head404(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def head200(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -123,7 +123,7 @@ def head204(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -165,7 +165,7 @@ def head404(self, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -112,7 +112,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements
async def _test_lro_initial(
self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -267,7 +267,7 @@ async def _test_lro_and_paging_initial(
test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -343,7 +343,7 @@ async def begin_test_lro_and_paging(

cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None)

error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -459,7 +459,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_one( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements
def _test_lro_initial(
self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any
) -> Iterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -342,7 +342,7 @@ def _test_lro_and_paging_initial(
test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,
**kwargs: Any
) -> Iterator[bytes]:
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -418,7 +418,7 @@ def begin_test_lro_and_paging(

cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None)

error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -534,7 +534,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any)
:rtype: ~azure.multiapi.sample.v2.models.ModelTwo
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -112,7 +112,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def test_two(
:rtype: ~azure.multiapi.sample.v2.models.ModelTwo
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -163,7 +163,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Loading

0 comments on commit 2ef47f9

Please sign in to comment.