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

CONFIG SET - add the ability to set multiple parameters in one call #2143

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

dvora-h
Copy link
Collaborator

@dvora-h dvora-h commented Apr 26, 2022

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

closes #2122

@dvora-h dvora-h added feature New feature redis-7 labels Apr 26, 2022
@dvora-h dvora-h requested a review from chayim April 26, 2022 14:41
"""Set config item ``name`` with ``value``

For more information see https://redis.io/commands/config-set
"""
return self.execute_command("CONFIG SET", name, value, **kwargs)
return self.execute_command("CONFIG SET", name, value, *args, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean.

@@ -686,6 +686,16 @@ def test_config_set(self, r):
assert r.config_set("timeout", 0)
assert r.config_get()["timeout"] == "0"

@skip_if_server_version_lt("7.0.0")
@skip_if_redis_enterprise()
def test_config_set_multi_params(self, r: redis.Redis):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a lazy, future option for writing tests like this (psuedocode). It comes from a pattern used in go:

x = [('timeout', 70), ('maxmemory', 100)]
r.config_set(*x)
for y in x:
    assert r.config_get(x[0]) == x[1]

@dvora-h dvora-h merged commit c198612 into redis:master Apr 27, 2022
@dvora-h dvora-h deleted the config-set branch May 9, 2022 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CONFIG SET - add the ability to set multiple parameters in one call
2 participants