Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented COMMAND DOCS by always throwing NotImplementedError #2020

Merged
merged 8 commits into from
Mar 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,15 @@ def command_info(self, **kwargs) -> None:
def command_count(self, **kwargs) -> ResponseT:
return self.execute_command("COMMAND COUNT", **kwargs)

def command_docs(self, *args):
"""
This function throws a NotImplementedError since it is intentionally
not supported.
"""
raise NotImplementedError(
"COMMAND DOCS is intentionally not implemented in the client."
)

def config_get(self, pattern: PatternT = "*", **kwargs) -> ResponseT:
"""
Return a dictionary of configuration based on the ``pattern``
Expand Down
5 changes: 5 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4212,6 +4212,11 @@ def test_command_count(self, r):
assert isinstance(res, int)
assert res >= 100

# @skip_if_server_versiov_lt("7.0.0")
def test_command_docs(self, unstable_r):
with pytest.raises(NotImplementedError):
unstable_r.command_docs("set")

@pytest.mark.onlynoncluster
@skip_if_server_version_lt("2.8.13")
def test_command_getkeys(self, r):
Expand Down