8000 pylance warnings corrections for List arguments (#1491) · yosshy/botbuilder-python@b458369 · GitHub
[go: up one dir, main page]

Skip to content

Commit b458369

Browse files
authored
pylance warnings corrections for List arguments (microsoft#1491)
1 parent 08076e2 commit b458369

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import hmac
66
import json
77
from io import IOBase
8-
from typing import Union
8+
from typing import List, Union
99

1010
import aiohttp
1111
from aiohttp.web_request import Request
@@ -116,7 +116,7 @@ async def files_list_ex(
116116
date_to: str = None,
117117
count: int = None,
118118
page: int = None,
119-
types: [str] = None,
119+
types: List[str] = None,
120120
) -> SlackResponse:
121121
args = {}
122122

@@ -185,7 +185,7 @@ async def chat_post_ephemeral_ex(
185185
target_user: str,
186186
parse: str = None,
187187
link_names: bool = False,
188-
attachments: [str] = None, # pylint: disable=unused-argument
188+
attachments: List[str] = None, # pylint: disable=unused-argument
189189
as_user: bool = False,
190190
) -> SlackResponse:
191191
args = {
@@ -210,8 +210,8 @@ async def chat_post_message_ex(
210210
bot_name: str = None,
211211
parse: str = None,
212212
link_names: bool = False,
213-
blocks: [str] = None, # pylint: disable=unused-argument
214-
attachments: [str] = None, # pylint: disable=unused-argument
213+
blocks: List[str] = None, # pylint: disable=unused-argument
214+
attachments: List[str] = None, # pylint: disable=unused-argument
215215
unfurl_links: bool = False,
216216
icon_url: str = None,
217217
icon_emoji: str = None,
@@ -328,7 +328,7 @@ async def chat_update_ex(
328328
bot_name: str = None,
329329
parse: str = None,
330330
link_names: bool = False,
331-
attachments: [str] = None, # pylint: disable=unused-argument
331+
attachments: List[str] = None, # pylint: disable=unused-argument
332332
as_user: bool = False,
333333
):
334334
args = {
@@ -353,7 +353,7 @@ async def files_upload_ex(
353353
self,
354354
file: Union[str, IOBase] = None,
355355
content: str = None,
356-
channels: [str] = None,
356+
channels: List[str] = None,
357357
title: str = None,
358358
initial_comment: str = None,
359359
file_type: str = None,

libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_event.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
from typing import List
45
from botbuilder.adapters.slack.slack_message import SlackMessage
56

67

@@ -24,7 +25,7 @@ def __init__(self, **kwargs):
2425
self.user = kwargs.get("user")
2526
self.user_id = kwargs.get("user_id")
2627
self.bot_id = kwargs.get("bot_id")
27-
self.actions: [str] = kwargs.get("actions")
28+
self.actions: List[str] = kwargs.get("actions")
2829
self.item = kwargs.get("item")
2930
self.item_channel = kwargs.get("item_channel")
3031
self.files: [] = kwargs.get("files")

libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class SlackPayload:
1010
def __init__(self, **kwargs):
11-
self.type: [str] = kwargs.get("type")
11+
self.type: List[str] = kwargs.get("type")
1212
self.token: str = kwargs.get("token")
1313
self.channel: str = kwargs.get("channel")
1414
self.thread_ts: str = kwargs.get("thread_ts")

libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
from typing import List
45
from botbuilder.adapters.slack.slack_event import SlackEvent
56
from botbuilder.adapters.slack.slack_payload import SlackPayload
67

@@ -14,7 +15,7 @@ def __init__(self, **kwargs):
1415
self.type = kwargs.get("type")
1516
self.event_id = kwargs.get("event_id")
1617
self.event_time = kwargs.get("event_time")
17-
self.authed_users: [str] = kwargs.get("authed_users")
18+
self.authed_users: List[str] = kwargs.get("authed_users")
1819
self.trigger_id = kwargs.get("trigger_id")
1920
self.channel_id = kwargs.get("channel_id")
2021
self.user_id = kwargs.get("user_id")

libraries/botbuilder-ai/botbuilder/ai/qna/utils/qna_card_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
from typing import List
45
from botbuilder.core import CardFactory
56
from botbuilder.schema import Activity, ActivityTypes, CardAction, HeroCard
67

@@ -14,7 +15,7 @@ class QnACardBuilder:
1415

1516
@staticmethod
1617
def get_suggestions_card(
17-
suggestions: [str], card_title: str, card_no_match: str
18+
suggestions: List[str], card_title: str, card_no_match: str
1819
) -> Activity:
1920
"""
2021
Get active learning suggestions card.

libraries/botbuilder-schema/botbuilder/schema/health_results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
from typing import List
45
from msrest.serialization import Model
56

67

@@ -19,7 +20,7 @@ def __init__(
1920
success: bool = None,
2021
authorization: str = None,
2122
user_agent: str = None,
22-
messages: [str] = None,
23+
messages: List[str] = None,
2324
diagnostics: object = None,
2425
**kwargs
2526
) -> None:

0 commit comments

Comments
 (0)
0