Skip to content

Commit 7c28321

Browse files
authored
core[patch]: fix deprecation admonition in API ref (#28992)
Before: ![Screenshot 2025-01-02 at 1 49 30 PM](https://github.com/user-attachments/assets/cb30526a-fc0b-439f-96d1-962c226d9dc7) After: ![Screenshot 2025-01-02 at 1 49 38 PM](https://github.com/user-attachments/assets/32c747ea-6391-4dec-b778-df457695d197)
1 parent d57f0c4 commit 7c28321

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libs/core/langchain_core/_api/deprecation.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,9 @@ def finalize(wrapper: Callable[..., Any], new_doc: str) -> T:
360360
_addendum,
361361
]
362362
details = " ".join([component.strip() for component in components if component])
363-
package = (
364-
_package or _name.split(".")[0].replace("_", "-") if "." in _name else None
363+
package = _package or (
364+
_name.split(".")[0].replace("_", "-") if "." in _name else None
365365
)
366-
since_str = f"{package}=={since}" if package else since
367366
if removal:
368367
if removal.startswith("1.") and package and package.startswith("langchain"):
369368
removal_str = f"It will not be removed until {package}=={removal}."
@@ -372,7 +371,7 @@ def finalize(wrapper: Callable[..., Any], new_doc: str) -> T:
372371
else:
373372
removal_str = ""
374373
new_doc = f"""\
375-
.. deprecated:: {since_str} {details} {removal_str}
374+
.. deprecated:: {since} {details} {removal_str}
376375
377376
{old_doc}\
378377
"""

0 commit comments

Comments
 (0)