[PR #75] [MERGED] refactor: update code to use pydantic v2 imports #86

Closed
opened 2026-02-16 07:16:13 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-pinecone/pull/75
Author: @paveltsialnou
Created: 9/8/2025
Status: Merged
Merged: 10/10/2025
Merged by: @jamescalam

Base: mainHead: main


📝 Commits (1)

  • eafc2ec refactor: update code to use pydantic v2 imports

📊 Changes

3 files changed (+5 additions, -2 deletions)

View changed files

📝 libs/pinecone/langchain_pinecone/vectorstores.py (+1 -1)
📝 libs/pinecone/pyproject.toml (+1 -0)
📝 libs/pinecone/uv.lock (+3 -1)

📄 Description

Replaced deprecated langchain_core.pydantic_v1 import with pydantic directly to address the following warning:

LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain_core.pydantic_v1 module was a compatibility shim for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly.

For example, replace imports like: `from langchain_core.pydantic_v1 import BaseModel`
with: `from pydantic import BaseModel`
or the v1 compatibility namespace if you are working in a code base that has not been fully upgraded to pydantic 2 yet.         from pydantic.v1 import BaseModel

  from langchain_pinecone.vectorstores import Pinecone, PineconeVectorStore

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-pinecone/pull/75 **Author:** [@paveltsialnou](https://github.com/paveltsialnou) **Created:** 9/8/2025 **Status:** ✅ Merged **Merged:** 10/10/2025 **Merged by:** [@jamescalam](https://github.com/jamescalam) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`eafc2ec`](https://github.com/langchain-ai/langchain-pinecone/commit/eafc2ecac13ebd770d317ee803b9c09fea5aa9ca) refactor: update code to use pydantic v2 imports ### 📊 Changes **3 files changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `libs/pinecone/langchain_pinecone/vectorstores.py` (+1 -1) 📝 `libs/pinecone/pyproject.toml` (+1 -0) 📝 `libs/pinecone/uv.lock` (+3 -1) </details> ### 📄 Description Replaced deprecated `langchain_core.pydantic_v1` import with `pydantic` directly to address the following warning: ``` LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain_core.pydantic_v1 module was a compatibility shim for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly. For example, replace imports like: `from langchain_core.pydantic_v1 import BaseModel` with: `from pydantic import BaseModel` or the v1 compatibility namespace if you are working in a code base that has not been fully upgraded to pydantic 2 yet. from pydantic.v1 import BaseModel from langchain_pinecone.vectorstores import Pinecone, PineconeVectorStore ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 07:16:13 -05:00
yindo closed this issue 2026-02-16 07:16:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-pinecone#86