From eefe3ab371db40ac6d0d54d15cc18fc81e94dfbf Mon Sep 17 00:00:00 2001 From: Pedram Parsian Date: Sun, 3 Dec 2023 04:20:52 +0330 Subject: [PATCH] Add "sum" to DUPLICATE_POLICY documentation of TS.CREATE, TS.ADD and TS.ALTER (#3027) --- CHANGES | 1 + redis/commands/timeseries/commands.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index ef983e4b51..191286d4af 100644 --- a/CHANGES +++ b/CHANGES @@ -56,6 +56,7 @@ * Fix for Unhandled exception related to self.host with unix socket (#2496) * Improve error output for master discovery * Make `ClusterCommandsProtocol` an actual Protocol + * Add `sum` to DUPLICATE_POLICY documentation of `TS.CREATE`, `TS.ADD` and `TS.ALTER` * 4.1.3 (Feb 8, 2022) * Fix flushdb and flushall (#1926) diff --git a/redis/commands/timeseries/commands.py b/redis/commands/timeseries/commands.py index 1cb183d087..208ddfb09f 100644 --- a/redis/commands/timeseries/commands.py +++ b/redis/commands/timeseries/commands.py @@ -59,6 +59,9 @@ def create( - 'last': override with latest value. - 'min': only override if the value is lower than the existing value. - 'max': only override if the value is higher than the existing value. + - 'sum': If a previous sample exists, add the new sample to it so that \ + the updated value is equal to (previous + new). If no previous sample \ + exists, set the updated value equal to the new value. For more information: https://redis.io/commands/ts.create/ """ # noqa @@ -103,6 +106,9 @@ def alter( - 'last': override with latest value. - 'min': only override if the value is lower than the existing value. - 'max': only override if the value is higher than the existing value. + - 'sum': If a previous sample exists, add the new sample to it so that \ + the updated value is equal to (previous + new). If no previous sample \ + exists, set the updated value equal to the new value. For more information: https://redis.io/commands/ts.alter/ """ # noqa @@ -154,6 +160,9 @@ def add( - 'last': override with latest value. - 'min': only override if the value is lower than the existing value. - 'max': only override if the value is higher than the existing value. + - 'sum': If a previous sample exists, add the new sample to it so that \ + the updated value is equal to (previous + new). If no previous sample \ + exists, set the updated value equal to the new value. For more information: https://redis.io/commands/ts.add/ """ # noqa