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

core[patch]: remove redundant imports #28861

Merged
merged 2 commits into from
Dec 23, 2024
Merged

Conversation

WrRan
Copy link
Contributor

@WrRan WrRan commented Dec 21, 2024

Graph has been imported at Line: 62

remove useless statements
Copy link

vercel bot commented Dec 21, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 21, 2024 4:54am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Dec 21, 2024
@@ -279,7 +279,7 @@ def _create_subset_model_v2(
fn_description: Optional[str] = None,
) -> type[pydantic.BaseModel]:
"""Create a pydantic model with a subset of the model fields."""
from pydantic import ConfigDict, create_model
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same issue. ConfigDict is imported at Line: 24

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was added in #27045, when the module-level import already existed, possibly to be explicit vs. the other _v1 function.

cc @eyurtsev

@@ -534,8 +534,6 @@ def get_config_jsonschema(

def get_graph(self, config: Optional[RunnableConfig] = None) -> Graph:
"""Return a graph representation of this Runnable."""
from langchain_core.runnables.graph import Graph
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like the module-level import was originally just for type checking; that was later changed but this import was not removed 7d5800e

@@ -279,7 +279,7 @@ def _create_subset_model_v2(
fn_description: Optional[str] = None,
) -> type[pydantic.BaseModel]:
"""Create a pydantic model with a subset of the model fields."""
from pydantic import ConfigDict, create_model
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was added in #27045, when the module-level import already existed, possibly to be explicit vs. the other _v1 function.

cc @eyurtsev

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Dec 23, 2024
@ccurme ccurme changed the title Update base.py: remove redundant imports core[patch]: remove redundant imports Dec 23, 2024
@ccurme ccurme merged commit e5c9da3 into langchain-ai:master Dec 23, 2024
82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging. 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants