Skip to content

Commit 8f24d87

Browse files
committed
fix: resolve mypy type errors for langgraph ToolNode fallback
- Use class-based fallback instead of assignment for ToolNode in TYPE_CHECKING block - Add type: ignore for no-redef to handle the intentional redefinition - This fixes compatibility with Python 3.9 mypy type checking
1 parent 6dcf323 commit 8f24d87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stackone_ai/integrations/langgraph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
try:
2525
from langgraph.prebuilt import ToolNode
2626
except Exception: # pragma: no cover
27-
ToolNode = Any
27+
28+
class ToolNode: # type: ignore[no-redef]
29+
pass
2830

2931

3032
def _ensure_langgraph() -> None:

0 commit comments

Comments
 (0)