From 18633bc99e6b9ae7c11fc9d2ec050e271c569701 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 15 Jul 2025 11:01:29 +1000 Subject: [PATCH] =?UTF-8?q?fix(langgraph):=20add=20`stacklevel=3D2`=20to?= =?UTF-8?q?=20the=20warnings=20to=20point=20to=20the=20caller=E2=80=99s=20?= =?UTF-8?q?codes=20(#5457)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore: add stacklevel=2 to the warnings to point to the caller’s codes --- libs/langgraph/langgraph/func/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/langgraph/langgraph/func/__init__.py b/libs/langgraph/langgraph/func/__init__.py index ba0b3c4cb..fa2e09ad7 100644 --- a/libs/langgraph/langgraph/func/__init__.py +++ b/libs/langgraph/langgraph/func/__init__.py @@ -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]