Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation Warnings for Pydantic V1 Usage #866

Open
Maralai opened this issue Jul 4, 2024 · 0 comments
Open

Deprecation Warnings for Pydantic V1 Usage #866

Maralai opened this issue Jul 4, 2024 · 0 comments

Comments

@Maralai
Copy link

Maralai commented Jul 4, 2024

When using crewAI, I'm encountering deprecation warnings related to Pydantic V1 usage. These warnings suggest that the library is using some deprecated Pydantic V1 features that will be removed in Pydantic V3.0.

Warnings

  1. Support for class-based config is deprecated:
PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/

This warning appears to be coming from crewai/task.py.

  1. Pydantic V1 style @validator is deprecated:
PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/

This warning appears to be coming from crewai_tools/tools/base_tool.py.

Suggested Action

It would be beneficial to update the codebase to use Pydantic V2 features instead of the deprecated V1 features. This will ensure compatibility with future versions of Pydantic and remove these deprecation warnings.

Additional Information

crewai version: 0.35.8

Though this is not recommended, we can ignore these specific warnings with the following code:

import warnings
from pydantic import PydanticDeprecatedSince20
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
warnings.filterwarnings("ignore", message="Pydantic V1 style `@validator` validators are deprecated")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant