From 51d65cff16170382333d5d3a9ea069f09c8d5c92 Mon Sep 17 00:00:00 2001 From: Pedram Parsian Date: Mon, 30 Oct 2023 13:05:36 +0330 Subject: [PATCH] Add "sum" to DUPLICATE_POLICY documentation of TS.CREATE, TS.ADD and TS.ALTER --- CHANGES | 1 + redis/commands/timeseries/commands.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 8cfc47db18..730cf1acc0 100644 --- a/CHANGES +++ b/CHANGES @@ -55,6 +55,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 13e3cdf498..ad137f2df0 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