Skip to content

Commit

Permalink
Mark json.resp as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Aug 23, 2023
1 parent 98fc959 commit 854c37c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions coredis/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def module_command(
command_name,
group,
version.Version(version_introduced) if version_introduced else None,
None,
version.Version(version_deprecated) if version_deprecated else None,
arguments,
cluster or ClusterCommandConfig(),
cache_config,
Expand Down Expand Up @@ -135,8 +135,10 @@ async def wrapped(*args: P.args, **kwargs: P.kwargs) -> R:
{module.FULL_NAME} command documentation: {redis_command_link(command_name)}
"""
if (
version_introduced and version_introduced != "1.0.0"
) or command_details.arguments:
(version_introduced and version_introduced != "1.0.0")
or version_deprecated
or command_details.arguments
):
wrapped.__doc__ += """
Compatibility:
"""
Expand All @@ -145,6 +147,10 @@ async def wrapped(*args: P.args, **kwargs: P.kwargs) -> R:
wrapped.__doc__ += f"""
- New in {module.FULL_NAME} version: `{version_introduced}`
"""
if version_deprecated:
wrapped.__doc__ += f"""
- Deprecated in {module.FULL_NAME} version: `{version_deprecated}`
"""
if command_details.arguments:
for argument, min_version in command_details.arguments.items():
wrapped.__doc__ += f"""
Expand Down
1 change: 1 addition & 0 deletions coredis/modules/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ async def type(
CommandName.JSON_RESP,
group=COMMAND_GROUP,
version_introduced="1.0.0",
version_deprecated="2.6.0",
module=MODULE,
flags={CommandFlag.READONLY},
)
Expand Down

0 comments on commit 854c37c

Please sign in to comment.