fix(langgraph): add stacklevel=2 to the warnings to point to the caller’s codes (#5457)

chore: add stacklevel=2 to the warnings to point to the caller’s codes
This commit is contained in:
Michael Li
2025-07-15 01:01:29 +00:00
committed by GitHub
parent 2558f81889
commit 18633bc99e
@@ -180,6 +180,7 @@ def task(
warnings.warn(
"`retry` is deprecated and will be removed. Please use `retry_policy` instead.",
category=LangGraphDeprecatedSinceV05,
stacklevel=2,
)
if retry_policy is None:
retry_policy = retry # type: ignore[assignment]
@@ -384,6 +385,7 @@ class entrypoint:
warnings.warn(
"`retry` is deprecated and will be removed. Please use `retry_policy` instead.",
category=LangGraphDeprecatedSinceV05,
stacklevel=2,
)
if retry_policy is None:
retry_policy = retry # type: ignore[assignment]