Skip to content

Commit c46f610

Browse files
mengyimicroclaude
andauthored
fix: Fix missing imports in teams_service.py for autoTriage (#184)
* fix: Fix missing imports in teams_service.py for autoTriage The teams_service.py was importing DailyDigestResult and WeeklyPlanResult models that don't exist in the autoTriage directory (they're part of the larger TeamAssistant backend). These imports were causing the auto-triage workflow to fail with ModuleNotFoundError. Solution: - Added `from __future__ import annotations` to make all type hints strings - Made imports conditional using TYPE_CHECKING - Type hints now work for development but don't fail at runtime - Auto-triage workflow can now import services without errors The Teams notification features (daily digest, weekly summary) are not used by the auto-triage workflow, so these optional imports don't affect functionality. Fixes the workflow error: ModuleNotFoundError: No module named 'models.daily_digest' Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: Remove unused Any import from teams_service.py --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4b35081 commit c46f610

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

autoTriage/services/teams_service.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
"""
55
Teams Service - Microsoft Teams webhook integration
66
"""
7+
from __future__ import annotations
8+
79
import os
810
import json
911
import logging
1012
import requests
11-
from typing import Any
12-
from models.daily_digest import DailyDigestResult
13-
from models.weekly_plan import WeeklyPlanResult
13+
from typing import TYPE_CHECKING
14+
15+
# Conditional imports for type hints only (these models don't exist in autoTriage)
16+
if TYPE_CHECKING:
17+
from models.daily_digest import DailyDigestResult
18+
from models.weekly_plan import WeeklyPlanResult
1419

1520

1621
class TeamsService:

0 commit comments

Comments
 (0)