Skip to content

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Sep 5, 2025

  • Add Raises sections
  • Add Returns sections
  • Add Yields sections

@cbornet cbornet requested a review from eyurtsev as a code owner September 5, 2025 18:18
Copy link

vercel bot commented Sep 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchain Ignored Ignored Preview Sep 8, 2025 3:44pm

Copy link

codspeed-hq bot commented Sep 5, 2025

CodSpeed WallTime Performance Report

Merging #32833 will not alter performance

Comparing cbornet:ruff-core-doc (5301a43) with master (4024d47)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Sep 5, 2025

CodSpeed Instrumentation Performance Report

Merging #32833 will not alter performance

Comparing cbornet:ruff-core-doc (5301a43) with master (4024d47)

Summary

✅ 14 untouched benchmarks

@cbornet cbornet force-pushed the ruff-core-doc branch 2 times, most recently from cb42fec to 985ec6a Compare September 6, 2025 07:22
@mdrxy mdrxy added linting Linting, formatting, or typing core Related to the package `langchain-core` labels Sep 8, 2025
@mdrxy mdrxy self-assigned this Sep 8, 2025
@mdrxy mdrxy requested a review from Copilot September 8, 2025 14:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes docstrings to comply with a DOC preview rule by:

  • Adding missing Returns sections to docstrings
  • Adding missing Raises sections to docstrings
  • Adding missing Yields sections to docstrings for generators
  • Removing duplicate/outdated docstrings to avoid redundancy
  • Improving consistency in docstring formatting

Reviewed Changes

Copilot reviewed 87 out of 87 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
libs/core/langchain_core/vectorstores/in_memory.py Removed duplicate docstrings for add_documents methods
libs/core/langchain_core/vectorstores/base.py Removed incomplete Raises sections
libs/core/langchain_core/utils/utils.py Added Returns sections and fixed formatting
libs/core/langchain_core/utils/pydantic.py Added Returns sections to utility functions
libs/core/langchain_core/utils/mustache.py Changed Returns to Yields for generator and improved function descriptions
libs/core/langchain_core/utils/loading.py Added Returns section
libs/core/langchain_core/utils/json_schema.py Added Returns sections
libs/core/langchain_core/utils/json.py Added Returns section
libs/core/langchain_core/utils/iter.py Improved descriptions and added Returns/Yields sections
libs/core/langchain_core/utils/interactive_env.py Added Returns section
libs/core/langchain_core/utils/function_calling.py Added Raises sections
libs/core/langchain_core/utils/env.py Added Returns section
libs/core/langchain_core/utils/aiter.py Fixed descriptions and added Returns/Yields sections
libs/core/langchain_core/tracers/schemas.py Added Returns section
libs/core/langchain_core/tracers/log_stream.py Added comprehensive Args/Raises/Returns sections
libs/core/langchain_core/tracers/langchain_v1.py Added Raises sections for deprecated functions
libs/core/langchain_core/tracers/langchain.py Added Returns section and removed duplicate docstring
libs/core/langchain_core/tracers/event_stream.py Added Returns sections and removed duplicate docstrings
libs/core/langchain_core/tracers/core.py Added Args sections and improved descriptions
libs/core/langchain_core/tracers/context.py Added Raises section for deprecated function
libs/core/langchain_core/tracers/base.py Improved copy method descriptions
libs/core/langchain_core/tools/* Added comprehensive Args/Returns/Raises sections
libs/core/langchain_core/stores.py Added override decorators and removed redundant docstrings
libs/core/langchain_core/runnables/* Added Returns/Yields sections and improved consistency
libs/core/langchain_core/* Similar improvements across remaining files

@@ -349,7 +354,7 @@ def _get_key(
def_ldel: str,
def_rdel: str,
) -> Any:
"""Get a key from the current scope."""
"""Return a key from the current scope."""
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The docstring should be 'Return the value of a key from the current scope' or 'Retrieve a key from the current scope' to be more accurate about what the function does.

Suggested change
"""Return a key from the current scope."""
"""Return the value of a key from the current scope, or from the list of scopes if not found in the current one."""

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

@cbornet cbornet Sep 8, 2025

Choose a reason for hiding this comment

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

Not the purpose of this PR to improve the docstring texts.
Also this one would be too long for the summary first line.

@mdrxy mdrxy enabled auto-merge (squash) September 8, 2025 15:43
@mdrxy mdrxy merged commit f4e83e0 into langchain-ai:master Sep 8, 2025
76 checks passed
@cbornet cbornet deleted the ruff-core-doc branch September 8, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the package `langchain-core` linting Linting, formatting, or typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants