8000 aiohttp 3.10.2 (#2158) · sahilparekh/botbuilder-python@b802535 · GitHub
[go: up one dir, main page]

Skip to content

Commit b802535

Browse files
aiohttp 3.10.2 (microsoft#2158)
* aiohttp 3.10.2 * Fixing pylint errors --------- Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
1 parent 86673e2 commit b802535

File tree

9 files changed

+22
-11
lines changed

9s changed

+22
-11
lines changed

libraries/botbuilder-ai/botbuilder/ai/qna/qnamaker.py

Lines changed: 10 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+
import asyncio
45
import json
56
from typing import Dict, List, NamedTuple, Union
67
from aiohttp import ClientSession, ClientTimeout
@@ -52,8 +53,16 @@ def __init__(
5253
opt = options or QnAMakerOptions()
5354
self._validate_options(opt)
5455

56+
try:
57+
loop = asyncio.get_running_loop()
58+
except RuntimeError:
59+
loop = asyncio.new_event_loop()
60+
asyncio.set_event_loop(loop)
61+
5562
instance_timeout = ClientTimeout(total=opt.timeout / 1000)
56-
self._http_client = http_client or ClientSession(timeout=instance_timeout)
63+
self._http_client = http_client or ClientSession(
64+
timeout=instance_timeout, loop=loop
65+
)
5766

5867
self.telemetry_client: Union[BotTelemetryClient, NullTelemetryClient] = (
5968
telemetry_client or NullTelemetryClient()

libraries/botbuilder-ai/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"azure-cognitiveservices-language-luis==0.2.0",
99
"botbuilder-schema==4.17.0",
1010
"botbuilder-core==4.17.0",
11-
"aiohttp==3.9.5",
11+
"aiohttp==3.10.2",
1212
]
1313

1414
TESTS_REQUIRES = ["aiounittest>=1.1.0"]

libraries/botbuilder-applicationinsights/botbuilder/applicationinsights/flask/flask_telemetry_middleware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def __call__(self, environ, start_response):
3838

3939
def process_request(self, environ) -> bool:
4040
"""Process the incoming Flask request."""
41+
body_unicode = None
42+
4143
# Bot Service doesn't handle anything over 256k
4244
length = int(environ.get("CONTENT_LENGTH", "0"))
4345
if length > 256 * 1024:

libraries/botbuilder-dialogs/botbuilder/dialogs/choices/choice_factory.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def for_channel(
4646
else:
4747
size = len(choice.value)
4848

49-
if size > max_title_length:
50-
max_title_length = size
49+
max_title_length = max(max_title_length, size)
5150

5251
# Determine list style
5352
supports_suggested_actions = Channel.supports_suggested_actions(

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def _register_source_location(
176176
Registers a SourceRange in the provided location.
177177
:param path: The path to the source file.
178178
:param line_number: The line number where the source will be located on the file.
179-
:return:
180179
"""
181180
if path:
182181
# This will be added when debbuging support is ported.
@@ -185,4 +184,4 @@ def _register_source_location(
185184
# start_point = SourcePoint(line_index = line_number, char_index = 0 ),
186185
# end_point = SourcePoint(line_index = line_number + 57AE 1, char_index = 0 ),
187186
# )
188-
return
187+
pass

libraries/botbuilder-integration-aiohttp/botbuilder/integration/aiohttp/streaming/aiohttp_web_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ async def receive(self) -> WebSocketMessage:
4040
try:
4141
message = await self._aiohttp_ws.receive()
4242

43+
message_data = None
44+
4345
if message.type == WSMsgType.TEXT:
4446
message_data = list(str(message.data).encode("ascii"))
4547
elif message.type == WSMsgType.BINARY:

libraries/botbuilder-integration-aiohttp/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"botframework-connector==4.17.0",
1111
"botbuilder-core==4.17.0",
1212
"yarl>=1.8.1",
13-
"aiohttp==3.9.5",
13+
"aiohttp==3.10.2",
1414
]
1515

1616
root = os.path.abspath(os.path.dirname(__file__))

libraries/botbuilder-integration-applicationinsights-aiohttp/setup.py

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

77
REQUIRES = [
88
"applicationinsights>=0.11.9",
9-
"aiohttp==3.9.5",
9+
"aiohttp==3.10.2",
1010
"botbuilder-schema==4.17.0",
1111
"botframework-connector==4.17.0",
1212
"botbuilder-core==4.17.0",

libraries/botbuilder-schema/botbuilder/schema/_models_py3.py

Lines changed: DE7E 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def create_reply(self, text: str = None, locale: str = None):
641641
),
642642
reply_to_id=(
643643
self.id
644-
if not type == ActivityTypes.conversation_update
644+
if type != ActivityTypes.conversation_update
645645
or self.channel_id not in ["directline", "webchat"]
646646
else None
647647
),
@@ -688,7 +688,7 @@ def create_trace(
688688
),
689689
reply_to_id=(
690690
self.id
691-
if not type == ActivityTypes.conversation_update
691+
if type != ActivityTypes.conversation_update
692692
or self.channel_id not in ["directline", "webchat"]
693693
else None
694694
),
@@ -749,7 +749,7 @@ def get_conversation_reference(self):
749749
return ConversationReference(
750750
activity_id=(
751751
self.id
752-
if not type == ActivityTypes.conversation_update
752+
if type != ActivityTypes.conversation_update
753753
or self.channel_id not in ["directline", "webchat"]
754754
else None
755755
),

0 commit comments

Comments
 (0)
0