From 411285f5efe74be20798fad69f8bb4e0f561ff4c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 01:23:10 +0000 Subject: [PATCH] fix: TypedDict compatibility for Python 3.11 and remove unused imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use typing_extensions.TypedDict instead of typing.TypedDict for Python < 3.12 compatibility - Remove unused pytest import from test_config.py - Remove unused sys import from test_factory.py - Fixes Pydantic error: 'Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12' Co-Authored-By: João --- src/crewai/rag/elasticsearch/types.py | 4 ++-- tests/rag/elasticsearch/test_config.py | 2 -- tests/rag/elasticsearch/test_factory.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/crewai/rag/elasticsearch/types.py b/src/crewai/rag/elasticsearch/types.py index c1f952b5a..9e23c68ab 100644 --- a/src/crewai/rag/elasticsearch/types.py +++ b/src/crewai/rag/elasticsearch/types.py @@ -1,7 +1,7 @@ """Type definitions for Elasticsearch RAG implementation.""" -from typing import Any, Protocol, TypedDict, Union, TYPE_CHECKING -from typing_extensions import NotRequired +from typing import Any, Protocol, Union, TYPE_CHECKING +from typing_extensions import NotRequired, TypedDict from pydantic import GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema diff --git a/tests/rag/elasticsearch/test_config.py b/tests/rag/elasticsearch/test_config.py index efd9e0979..f1956d5e4 100644 --- a/tests/rag/elasticsearch/test_config.py +++ b/tests/rag/elasticsearch/test_config.py @@ -1,7 +1,5 @@ """Tests for Elasticsearch configuration.""" -import pytest - from crewai.rag.elasticsearch.config import ElasticsearchConfig diff --git a/tests/rag/elasticsearch/test_factory.py b/tests/rag/elasticsearch/test_factory.py index e9307ae5c..f0cb6e357 100644 --- a/tests/rag/elasticsearch/test_factory.py +++ b/tests/rag/elasticsearch/test_factory.py @@ -1,6 +1,5 @@ """Tests for Elasticsearch factory.""" -import sys from unittest.mock import Mock, patch import pytest