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

distinguish between import and package name in error #28

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

axl1313
Copy link
Collaborator

@axl1313 axl1313 commented Feb 7, 2025

Adds distinction between import_name and package_name for missing dependency errors on lazy imports to support cases where the imported module name does not match the name of the actual installable package (i.e. pip install scikit-learn vs. import sklearn)

@axl1313 axl1313 merged commit 705b9d3 into main Feb 7, 2025
8 checks passed
@@ -126,7 +126,7 @@ def to_smolagents_tool(self) -> Any:
try:
from cleanlab_codex.utils.smolagents import CodexTool as SmolagentsCodexTool
except ImportError as e:
raise MissingDependencyError("smolagents", "https://github.com/huggingface/smolagents") from e
raise MissingDependencyError(e.name or "smolagents", "https://github.com/huggingface/smolagents") from e
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this supply the URL as the package_name argument to MissingDependencyError.__init__, rather than as the package_url argument?

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.

2 participants