From 01b524258daec51ccf0e552f554ec6563fabe42a Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Wed, 7 May 2025 10:01:17 +0900 Subject: [PATCH 1/2] Set `stacklevel` for `warnings.warn` Signed-off-by: Harutaka Kawamura --- databricks/sdk/errors/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/databricks/sdk/errors/base.py b/databricks/sdk/errors/base.py index 4e104c0b7..6cfcc2052 100644 --- a/databricks/sdk/errors/base.py +++ b/databricks/sdk/errors/base.py @@ -85,7 +85,8 @@ def __init__( # Retry-after is deprecated. if retry_after_secs: warnings.warn( - "The 'retry_after_secs' parameter of DatabricksError is deprecated and will be removed in a future version." + "The 'retry_after_secs' parameter of DatabricksError is deprecated and will be removed in a future version.", + stacklevel=2, ) if detail: From 3627012818facbd6640efa1ae4d86d94658a7ddd Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Wed, 7 May 2025 11:24:40 +0900 Subject: [PATCH 2/2] Update databricks/sdk/errors/base.py Signed-off-by: Harutaka Kawamura --- databricks/sdk/errors/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/databricks/sdk/errors/base.py b/databricks/sdk/errors/base.py index 6cfcc2052..92aab86eb 100644 --- a/databricks/sdk/errors/base.py +++ b/databricks/sdk/errors/base.py @@ -84,6 +84,7 @@ def __init__( # Retry-after is deprecated. if retry_after_secs: + raise Exception("who uses retry_after_secs?") warnings.warn( "The 'retry_after_secs' parameter of DatabricksError is deprecated and will be removed in a future version.", stacklevel=2,