|
2 | 2 | from json import JSONDecodeError, loads |
3 | 3 | from typing import Dict, List, Optional, Union |
4 | 4 |
|
5 | | -from deprecated import deprecated |
6 | | - |
7 | 5 | from redis.exceptions import DataError |
| 6 | +from redis.utils import warn_deprecated |
8 | 7 |
|
9 | 8 | from ._util import JsonType |
10 | 9 | from .decoders import decode_dict_keys |
@@ -137,13 +136,15 @@ def numincrby(self, name: str, path: str, number: int) -> str: |
137 | 136 | "JSON.NUMINCRBY", name, str(path), self._encode(number) |
138 | 137 | ) |
139 | 138 |
|
140 | | - @deprecated(version="4.0.0", reason="deprecated since redisjson 1.0.0") |
141 | 139 | def nummultby(self, name: str, path: str, number: int) -> str: |
142 | 140 | """Multiply the numeric (integer or floating point) JSON value under |
143 | 141 | ``path`` at key ``name`` with the provided ``number``. |
144 | 142 |
|
145 | 143 | For more information see `JSON.NUMMULTBY <https://redis.io/commands/json.nummultby>`_. |
146 | 144 | """ # noqa |
| 145 | + warn_deprecated( |
| 146 | + name="nummultby", reason="deprecated since redisjson 1.0.0", version="4.0.0" |
| 147 | + ) |
147 | 148 | return self.execute_command( |
148 | 149 | "JSON.NUMMULTBY", name, str(path), self._encode(number) |
149 | 150 | ) |
@@ -368,20 +369,26 @@ def debug( |
368 | 369 | pieces.append(str(path)) |
369 | 370 | return self.execute_command("JSON.DEBUG", *pieces) |
370 | 371 |
|
371 | | - @deprecated( |
372 | | - version="4.0.0", reason="redisjson-py supported this, call get directly." |
373 | | - ) |
374 | 372 | def jsonget(self, *args, **kwargs): |
| 373 | + warn_deprecated( |
| 374 | + name="jsonget", |
| 375 | + reason="redisjson-py supported this, call get directly.", |
| 376 | + version="4.0.0", |
| 377 | + ) |
375 | 378 | return self.get(*args, **kwargs) |
376 | 379 |
|
377 | | - @deprecated( |
378 | | - version="4.0.0", reason="redisjson-py supported this, call get directly." |
379 | | - ) |
380 | 380 | def jsonmget(self, *args, **kwargs): |
| 381 | + warn_deprecated( |
| 382 | + name="jsonmget", |
| 383 | + reason="redisjson-py supported this, call get directly.", |
| 384 | + version="4.0.0", |
| 385 | + ) |
381 | 386 | return self.mget(*args, **kwargs) |
382 | 387 |
|
383 | | - @deprecated( |
384 | | - version="4.0.0", reason="redisjson-py supported this, call get directly." |
385 | | - ) |
386 | 388 | def jsonset(self, *args, **kwargs): |
| 389 | + warn_deprecated( |
| 390 | + name="jsonset", |
| 391 | + reason="redisjson-py supported this, call get directly.", |
| 392 | + version="4.0.0", |
| 393 | + ) |
387 | 394 | return self.set(*args, **kwargs) |
0 commit comments