mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-22 10:59:22 +00:00
core[patch]: fix deprecation admonition in API ref (#28992)
Before:  After: 
This commit is contained in:
parent
d57f0c46da
commit
7c28321f04
@ -360,10 +360,9 @@ def deprecated(
|
|||||||
_addendum,
|
_addendum,
|
||||||
]
|
]
|
||||||
details = " ".join([component.strip() for component in components if component])
|
details = " ".join([component.strip() for component in components if component])
|
||||||
package = (
|
package = _package or (
|
||||||
_package or _name.split(".")[0].replace("_", "-") if "." in _name else None
|
_name.split(".")[0].replace("_", "-") if "." in _name else None
|
||||||
)
|
)
|
||||||
since_str = f"{package}=={since}" if package else since
|
|
||||||
if removal:
|
if removal:
|
||||||
if removal.startswith("1.") and package and package.startswith("langchain"):
|
if removal.startswith("1.") and package and package.startswith("langchain"):
|
||||||
removal_str = f"It will not be removed until {package}=={removal}."
|
removal_str = f"It will not be removed until {package}=={removal}."
|
||||||
@ -372,7 +371,7 @@ def deprecated(
|
|||||||
else:
|
else:
|
||||||
removal_str = ""
|
removal_str = ""
|
||||||
new_doc = f"""\
|
new_doc = f"""\
|
||||||
.. deprecated:: {since_str} {details} {removal_str}
|
.. deprecated:: {since} {details} {removal_str}
|
||||||
|
|
||||||
{old_doc}\
|
{old_doc}\
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user