Skip to content

Commit 0a46ae4

Browse files
brs96orazve
andcommitted
Emit deprecation warning in log and warning
Co-authored-by: Olga Razvenskaia <olga.razvenskaia@neo4j.com>
1 parent e0efafb commit 0a46ae4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graphdatascience/error/deprecation_warning.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from functools import wraps
23
from logging import warning
34
from typing import Any, Callable, Optional, TypeVar, cast
@@ -20,8 +21,9 @@ def decorator(func: F) -> F:
2021

2122
@wraps(func)
2223
def wrapper(self: WithServerVersion, *args: Any, **kwargs: Any) -> Any:
23-
if deprecation_start_version and self._server_version > deprecation_start_version:
24+
if deprecation_start_version and self._server_version >= deprecation_start_version:
2425
warning(f"Deprecated in favor of {new_procedure}")
26+
warnings.warn(f"Deprecated in favor of {new_procedure}", DeprecationWarning)
2527
return func(self, *args, **kwargs)
2628

2729
return cast(F, wrapper)

0 commit comments

Comments
 (0)