Skip to content

Commit

Permalink
Fix mixed types with Any
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Apr 28, 2024
1 parent 49829ad commit edcb605
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/pygeoapi/starlette_app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Starlette application override module."""

import asyncio
from typing import Any
from typing import Callable
from typing import Union

from pygeoapi.starlette_app import api_ as geoapi
from starlette.requests import Request
Expand Down Expand Up @@ -31,7 +31,7 @@ def call_api_threadsafe(
async def get_response(
api_call,
*args,
) -> Union[Response, JSONResponse, HTMLResponse]:
) -> Any:
"""Creates a Starlette Response object and updates matching headers.
Runs the core api handler in a separate thread in order to avoid
Expand All @@ -49,7 +49,7 @@ async def get_response(

headers, status, content = result
if headers["Content-Type"] == "text/html":
response = HTMLResponse(content=content, status_code=status)
response: Any = HTMLResponse(content=content, status_code=status)
else:
if isinstance(content, dict):
response = JSONResponse(content, status_code=status)
Expand Down

0 comments on commit edcb605

Please sign in to comment.