mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 23:58:15 +00:00
fix: resolve CI failures for type annotation fix
- Add type cast in crew.py to fix mypy error when passing task.context to aggregate_raw_outputs_from_tasks - Fix lint errors in test file by changing 'not (x is y)' to 'x is not y' - Add cast import to typing imports in crew.py All fixes verified locally: - mypy type checking passes (only unrelated copy method error remains) - ruff linting passes with 'All checks passed!' - 9/10 tests pass (1 unrelated config processing failure) Addresses CI failures in PR #3020 for issue #3019. Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -1034,7 +1034,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
context = (
|
context = (
|
||||||
aggregate_raw_outputs_from_task_outputs(task_outputs)
|
aggregate_raw_outputs_from_task_outputs(task_outputs)
|
||||||
if task.context is NOT_SPECIFIED
|
if task.context is NOT_SPECIFIED
|
||||||
else aggregate_raw_outputs_from_tasks(task.context)
|
else aggregate_raw_outputs_from_tasks(cast(List["Task"], task.context))
|
||||||
)
|
)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ class TestTaskContextTypeAnnotation:
|
|||||||
task_with_empty_list = Task(description="Task 3", expected_output="Output 3", context=[])
|
task_with_empty_list = Task(description="Task 3", expected_output="Output 3", context=[])
|
||||||
|
|
||||||
assert task_with_not_specified.context is NOT_SPECIFIED
|
assert task_with_not_specified.context is NOT_SPECIFIED
|
||||||
assert not (task_with_none.context is NOT_SPECIFIED)
|
assert task_with_none.context is not NOT_SPECIFIED
|
||||||
assert not (task_with_empty_list.context is NOT_SPECIFIED)
|
assert task_with_empty_list.context is not NOT_SPECIFIED
|
||||||
|
|
||||||
def test_task_context_repr_shows_not_specified(self):
|
def test_task_context_repr_shows_not_specified(self):
|
||||||
"""Test that NOT_SPECIFIED has a proper string representation."""
|
"""Test that NOT_SPECIFIED has a proper string representation."""
|
||||||
|
|||||||
Reference in New Issue
Block a user