Skip to content

Commit 1d9eb46

Browse files
committed
Fix mypy errors in CI
1 parent f0fe282 commit 1d9eb46

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

dash/background_callback/managers/diskcache_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, cache=None, cache_by=None, expire=None):
3636
is determined by the default behavior of the ``cache`` instance.
3737
"""
3838
try:
39-
import diskcache # type: ignore[import-not-found] # pylint: disable=import-outside-toplevel
39+
import diskcache # type: ignore[import-not-found,import-untyped] # pylint: disable=import-outside-toplevel
4040
import psutil # type: ignore[import-untyped] # noqa: F401,E402 pylint: disable=import-outside-toplevel,unused-import,unused-variable,import-error
4141
import multiprocess # type: ignore[import-untyped] # noqa: F401,E402 pylint: disable=import-outside-toplevel,unused-import,unused-variable
4242
except ImportError as missing_imports:

dash/mcp/primitives/tools/tools_callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def call_tool(
5959
)
6060

6161
if is_background:
62-
task_result = create_task(callback_response, cb)
62+
task_result = create_task(dict(callback_response), cb)
6363
if task is not None:
6464
return task_result
6565
return task_result_to_tool_result(task_result)

dash/mcp/tasks/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import json
66
from datetime import datetime, timezone
7-
from typing import Any
7+
from typing import Any, Literal
88

99
from mcp.types import CancelTaskResult, CreateTaskResult, GetTaskResult, Task
1010

@@ -15,7 +15,8 @@
1515

1616
def parse_task_id(task_id: str) -> tuple[str, str, str]:
1717
"""Parse a taskId into (tool_name, job_id, cache_key)."""
18-
return task_id.split(":", 2)
18+
tool_name, job_id, cache_key = task_id.split(":", 2)
19+
return tool_name, job_id, cache_key
1920

2021

2122
def _get_callback_manager():
@@ -66,6 +67,7 @@ def get_task(task_id: str) -> GetTaskResult:
6667
running = manager.job_running(job_id)
6768
progress = manager.get_progress(cache_key)
6869

70+
status: Literal["working", "completed", "failed"]
6971
if running:
7072
status = "working"
7173
elif manager.result_ready(cache_key):

0 commit comments

Comments
 (0)