[PR #2503] [MERGED] fix(ci): only flag langchain_core imports for symbols actually re-exported by langchain #2490

Closed
opened 2026-02-17 17:23:28 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2503
Author: @mdrxy
Created: 2/5/2026
Status: Merged
Merged: 2/5/2026
Merged by: @mdrxy

Base: mainHead: mdrxy/fix-check


📝 Commits (1)

  • c411c5c fix(ci): only flag langchain_core imports for symbols actually re-exported by langchain

📊 Changes

2 files changed (+45 additions, -11 deletions)

View changed files

📝 scripts/check_pr_imports.py (+24 -11)
📝 tests/unit_tests/test_check_pr_imports.py (+21 -0)

📄 Description

Fixes false positives in the import checker where symbols like BaseMessage were flagged despite not being re-exported by langchain.

The module-level mapping (langchain_core.messages -> langchain.messages) caused all imports from that module to be flagged.

Now each imported symbol is verified against the symbol-level mappings before flagging.


🔄 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/docs/pull/2503 **Author:** [@mdrxy](https://github.com/mdrxy) **Created:** 2/5/2026 **Status:** ✅ Merged **Merged:** 2/5/2026 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `main` ← **Head:** `mdrxy/fix-check` --- ### 📝 Commits (1) - [`c411c5c`](https://github.com/langchain-ai/docs/commit/c411c5c5d55bc1f383dde0eed5e0b7cd112c475a) fix(ci): only flag `langchain_core` imports for symbols actually re-exported by `langchain` ### 📊 Changes **2 files changed** (+45 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `scripts/check_pr_imports.py` (+24 -11) 📝 `tests/unit_tests/test_check_pr_imports.py` (+21 -0) </details> ### 📄 Description Fixes false positives in the import checker where symbols like `BaseMessage` were flagged despite not being re-exported by `langchain`. The module-level mapping (`langchain_core.messages` -> `langchain.messages`) caused all imports from that module to be flagged. Now each imported symbol is verified against the symbol-level mappings before flagging. --- <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-17 17:23:28 -05:00
yindo closed this issue 2026-02-17 17:23:28 -05:00
yindo changed title from [PR #2503] fix(ci): only flag `langchain_core` imports for symbols actually re-exported by `langchain` to [PR #2503] [MERGED] fix(ci): only flag `langchain_core` imports for symbols actually re-exported by `langchain` 2026-06-05 18:18:52 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#2490