Skip to content

fix(traceloop-sdk): Replace Pydantic 'Config' class with model_config for v2 compatibility #3028

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samikshaaagarwal
Copy link

@samikshaaagarwal samikshaaagarwal commented Jun 18, 2025

Fixes #2959

This PR replaces the deprecated use of class Config in RegistryObjectBaseModel with model_config = ConfigDict(...), making the code compatible with Pydantic v2.

Confirmed that the deprecation warning no longer appears after running tests.


Important

Replaced deprecated class Config with model_config = ConfigDict(...) in RegistryObjectBaseModel for Pydantic v2 compatibility and updated version to 0.40.9 across multiple packages.

  • Pydantic Compatibility:
    • Replaced class Config with model_config = ConfigDict(...) in RegistryObjectBaseModel in model.py for Pydantic v2 compatibility.
    • Added a fallback to class Config for Pydantic v1 in model.py.
  • Version Updates:
    • Updated version to 0.40.9 in pyproject.toml and version.py across multiple packages including alephalpha, anthropic, bedrock, chromadb, cohere, crewai, google-generativeai, groq, haystack, lancedb, langchain, llamaindex, marqo, mcp, milvus, mistralai, ollama, openai, pinecone, qdrant, replicate, sagemaker, together, transformers, vertexai, watsonx, weaviate, and traceloop-sdk.

This description was created by Ellipsis for 1bcf10b. You can customize this summary. It will automatically update as commits are pushed.

@CLAassistant
Copy link

CLAassistant commented Jun 18, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 1bcf10b in 1 minute and 26 seconds. Click for details.
  • Reviewed 606 lines of code in 57 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/traceloop-sdk/traceloop/sdk/prompts/model.py:12
  • Draft comment:
    Nice implementation for Pydantic v2 compatibility using model_config. Consider removing the redundant re-import of ConfigDict (already imported on line 5) if it isn’t strictly needed.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None
2. packages/traceloop-sdk/traceloop/sdk/version.py:1
  • Draft comment:
    Version bumped to 0.40.9 consistently across the SDK and instrumentation packages. Ensure the changelog accurately reflects this update.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. packages/opentelemetry-instrumentation-mistralai/pyproject.toml:14
  • Draft comment:
    Typo found: The repository URL contains 'openllmetry' which might be a misspelling of 'opentelemetry'. Please verify if this is intentional.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_nmHI5XvU7SuBSWIa

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Member

@nirga nirga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @samikshaaagarwal! Can you rebase and sign the CLA?

@samikshaaagarwal
Copy link
Author

Hi @nirga , rebased the branch with the latest main, resolved all merge conflicts and signed the CLA. Lemme know if there is anything else you'd like me to change. Thanks! :)

@nirga nirga changed the title Fix: Replace Pydantic 'Config' class with model_config for v2 compatibility fix(traceloop-sdk): Replace Pydantic 'Config' class with model_config for v2 compatibility Jun 24, 2025
Copy link
Member

@nirga nirga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spullara! Mind reverting the changelog file and fixing the lint?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert?

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

Successfully merging this pull request may close these issues.

🐛 Bug Report: pydantic warning: Support for class-based config is deprecated, use ConfigDict instead
3 participants