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

community: import fix #20995

Merged
merged 3 commits into from Apr 29, 2024
Merged

Conversation

leo-gan
Copy link
Collaborator

@leo-gan leo-gan commented Apr 28, 2024

Issue: When the third-party package is not installed, whenever we need to pip install <package> the ImportError is raised.
But sometimes, the ValueError or ModuleNotFoundError is raised. It is bad for consistency.
Change: replaced the ValueError or ModuleNotFoundError with ImportError when we raise an error with the pip install <package> message.
Note: Ideally, we replace all try: import... except... raise ... with helper functions like import_aim or just use the existing langchain_core.utils.utils.guard_import But it would be much bigger refactoring. @baskaryan Please, advice on this.

Copy link

vercel bot commented Apr 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Apr 28, 2024 8:47pm

@leo-gan leo-gan marked this pull request as ready for review April 28, 2024 20:51
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🤖:improvement Medium size change to existing code to handle new use-cases labels Apr 28, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Apr 29, 2024
@baskaryan baskaryan merged commit dc7c06b into langchain-ai:master Apr 29, 2024
60 checks passed
@leo-gan
Copy link
Collaborator Author

leo-gan commented Apr 29, 2024

@baskaryan Thanks!

@leo-gan leo-gan deleted the community-ImportError-fix branch April 29, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants