Skip to content

Commit

Permalink
fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Nov 5, 2021
1 parent 4016745 commit cc6bff7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rasa/core/channels/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async def process_message(
)

return response.text(
None, status=HTTPStatus.CREATED, headers={"X-Slack-No-Retry": 1}
None, status=HTTPStatus.CREATED, headers={"X-Slack-No-Retry": "1"}
)

if metadata is not None:
Expand Down
2 changes: 1 addition & 1 deletion rasa/core/channels/twilio_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def health(request: Request) -> HTTPResponse:
return response.json({"status": "ok"})

@twilio_voice_webhook.route("/webhook", methods=["POST"])
async def receive(request: Request) -> Text:
async def receive(request: Request) -> HTTPResponse:
sender_id = request.form.get("From")
text = request.form.get("SpeechResult")
input_channel = self.name()
Expand Down
8 changes: 4 additions & 4 deletions rasa/core/training/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,15 +1623,15 @@ async def ignore_404s(request: Request, exception: Exception) -> HTTPResponse:

# noinspection PyUnusedLocal
@app.route(VISUALIZATION_TEMPLATE_PATH, methods=["GET"])
def visualisation_html(request: Request) -> HTTPResponse:
return response.file(visualization.visualization_html_path())
async def visualisation_html(request: Request) -> HTTPResponse:
return await response.file(visualization.visualization_html_path())

# noinspection PyUnusedLocal
@app.route("/visualization.dot", methods=["GET"])
def visualisation_png(request: Request,) -> HTTPResponse:
async def visualisation_png(request: Request,) -> HTTPResponse:
try:
headers = {"Cache-Control": "no-cache"}
return response.file(os.path.abspath(image_path), headers=headers)
return await response.file(os.path.abspath(image_path), headers=headers)
except FileNotFoundError:
return response.text("", 404)

Expand Down

0 comments on commit cc6bff7

Please sign in to comment.