Fix pre-existing lint and type-checker errors in flow.py

- Import PrinterColor type from utilities.printer
- Replace unused variable 'condition_type' with '_' at line 1091
- Fix type annotation for '_log_flow_event' color parameter to use PrinterColor instead of str

These were pre-existing errors that prevented CI from passing after modifying flow.py

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-10-01 17:37:53 +00:00
parent 1ce52c6616
commit 53d94df7de

View File

@@ -31,7 +31,7 @@ from crewai.flow.flow_visualizer import plot_flow
from crewai.flow.persistence.base import FlowPersistence
from crewai.flow.types import FlowExecutionData
from crewai.flow.utils import get_possible_return_constants
from crewai.utilities.printer import Printer
from crewai.utilities.printer import Printer, PrinterColor
logger = logging.getLogger(__name__)
@@ -1088,7 +1088,7 @@ class Flow(Generic[T], metaclass=FlowMeta):
for method_name in self._start_methods:
# Check if this start method is triggered by the current trigger
if method_name in self._listeners:
condition_type, trigger_methods = self._listeners[
_, trigger_methods = self._listeners[
method_name
]
if current_trigger in trigger_methods:
@@ -1220,7 +1220,7 @@ class Flow(Generic[T], metaclass=FlowMeta):
raise
def _log_flow_event(
self, message: str, color: str = "yellow", level: str = "info"
self, message: str, color: PrinterColor = "yellow", level: str = "info"
) -> None:
"""Centralized logging method for flow events.