summaryrefslogtreecommitdiff
path: root/redis/commands
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands')
-rw-r--r--redis/commands/bf/__init__.py22
-rw-r--r--redis/commands/bf/commands.py42
-rw-r--r--redis/commands/graph/__init__.py20
-rw-r--r--redis/commands/graph/edge.py2
-rw-r--r--redis/commands/graph/node.py2
-rw-r--r--redis/commands/graph/query_result.py4
-rw-r--r--redis/commands/helpers.py2
-rw-r--r--redis/commands/json/commands.py28
-rw-r--r--redis/commands/json/path.py2
-rw-r--r--redis/commands/search/commands.py6
-rw-r--r--redis/commands/search/indexDefinition.py24
-rw-r--r--redis/commands/timeseries/commands.py100
12 files changed, 127 insertions, 127 deletions
diff --git a/redis/commands/bf/__init__.py b/redis/commands/bf/__init__.py
index f34e11d..d62d8a0 100644
--- a/redis/commands/bf/__init__.py
+++ b/redis/commands/bf/__init__.py
@@ -18,70 +18,70 @@ class AbstractBloom(object):
"""
@staticmethod
- def appendItems(params, items):
+ def append_items(params, items):
"""Append ITEMS to params."""
params.extend(["ITEMS"])
params += items
@staticmethod
- def appendError(params, error):
+ def append_error(params, error):
"""Append ERROR to params."""
if error is not None:
params.extend(["ERROR", error])
@staticmethod
- def appendCapacity(params, capacity):
+ def append_capacity(params, capacity):
"""Append CAPACITY to params."""
if capacity is not None:
params.extend(["CAPACITY", capacity])
@staticmethod
- def appendExpansion(params, expansion):
+ def append_expansion(params, expansion):
"""Append EXPANSION to params."""
if expansion is not None:
params.extend(["EXPANSION", expansion])
@staticmethod
- def appendNoScale(params, noScale):
+ def append_no_scale(params, noScale):
"""Append NONSCALING tag to params."""
if noScale is not None:
params.extend(["NONSCALING"])
@staticmethod
- def appendWeights(params, weights):
+ def append_weights(params, weights):
"""Append WEIGHTS to params."""
if len(weights) > 0:
params.append("WEIGHTS")
params += weights
@staticmethod
- def appendNoCreate(params, noCreate):
+ def append_no_create(params, noCreate):
"""Append NOCREATE tag to params."""
if noCreate is not None:
params.extend(["NOCREATE"])
@staticmethod
- def appendItemsAndIncrements(params, items, increments):
+ def append_items_and_increments(params, items, increments):
"""Append pairs of items and increments to params."""
for i in range(len(items)):
params.append(items[i])
params.append(increments[i])
@staticmethod
- def appendValuesAndWeights(params, items, weights):
+ def append_values_and_weights(params, items, weights):
"""Append pairs of items and weights to params."""
for i in range(len(items)):
params.append(items[i])
params.append(weights[i])
@staticmethod
- def appendMaxIterations(params, max_iterations):
+ def append_max_iterations(params, max_iterations):
"""Append MAXITERATIONS to params."""
if max_iterations is not None:
params.extend(["MAXITERATIONS", max_iterations])
@staticmethod
- def appendBucketSize(params, bucket_size):
+ def append_bucket_size(params, bucket_size):
"""Append BUCKETSIZE to params."""
if bucket_size is not None:
params.extend(["BUCKETSIZE", bucket_size])
diff --git a/redis/commands/bf/commands.py b/redis/commands/bf/commands.py
index 7fc507d..e911efc 100644
--- a/redis/commands/bf/commands.py
+++ b/redis/commands/bf/commands.py
@@ -62,8 +62,8 @@ class BFCommands:
For more information see `BF.RESERVE <https://oss.redis.com/redisbloom/master/Bloom_Commands/#bfreserve>`_.
""" # noqa
params = [key, errorRate, capacity]
- self.appendExpansion(params, expansion)
- self.appendNoScale(params, noScale)
+ self.append_expansion(params, expansion)
+ self.append_no_scale(params, noScale)
return self.execute_command(BF_RESERVE, *params)
def add(self, key, item):
@@ -102,12 +102,12 @@ class BFCommands:
For more information see `BF.INSERT <https://oss.redis.com/redisbloom/master/Bloom_Commands/#bfinsert>`_.
""" # noqa
params = [key]
- self.appendCapacity(params, capacity)
- self.appendError(params, error)
- self.appendExpansion(params, expansion)
- self.appendNoCreate(params, noCreate)
- self.appendNoScale(params, noScale)
- self.appendItems(params, items)
+ self.append_capacity(params, capacity)
+ self.append_error(params, error)
+ self.append_expansion(params, expansion)
+ self.append_no_create(params, noCreate)
+ self.append_no_scale(params, noScale)
+ self.append_items(params, items)
return self.execute_command(BF_INSERT, *params)
@@ -177,9 +177,9 @@ class CFCommands:
For more information see `CF.RESERVE <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfreserve>`_.
""" # noqa
params = [key, capacity]
- self.appendExpansion(params, expansion)
- self.appendBucketSize(params, bucket_size)
- self.appendMaxIterations(params, max_iterations)
+ self.append_expansion(params, expansion)
+ self.append_bucket_size(params, bucket_size)
+ self.append_max_iterations(params, max_iterations)
return self.execute_command(CF_RESERVE, *params)
def add(self, key, item):
@@ -207,9 +207,9 @@ class CFCommands:
For more information see `CF.INSERT <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfinsert>`_.
""" # noqa
params = [key]
- self.appendCapacity(params, capacity)
- self.appendNoCreate(params, nocreate)
- self.appendItems(params, items)
+ self.append_capacity(params, capacity)
+ self.append_no_create(params, nocreate)
+ self.append_items(params, items)
return self.execute_command(CF_INSERT, *params)
def insertnx(self, key, items, capacity=None, nocreate=None):
@@ -220,9 +220,9 @@ class CFCommands:
For more information see `CF.INSERTNX <https://oss.redis.com/redisbloom/master/Cuckoo_Commands/#cfinsertnx>`_.
""" # noqa
params = [key]
- self.appendCapacity(params, capacity)
- self.appendNoCreate(params, nocreate)
- self.appendItems(params, items)
+ self.append_capacity(params, capacity)
+ self.append_no_create(params, nocreate)
+ self.append_items(params, items)
return self.execute_command(CF_INSERTNX, *params)
def exists(self, key, item):
@@ -315,7 +315,7 @@ class TOPKCommands:
>>> topkincrby('A', ['foo'], [1])
""" # noqa
params = [key]
- self.appendItemsAndIncrements(params, items, increments)
+ self.append_items_and_increments(params, items, increments)
return self.execute_command(TOPK_INCRBY, *params)
def query(self, key, *items):
@@ -383,7 +383,7 @@ class TDigestCommands:
>>> tdigestadd('A', [1500.0], [1.0])
""" # noqa
params = [key]
- self.appendValuesAndWeights(params, values, weights)
+ self.append_values_and_weights(params, values, weights)
return self.execute_command(TDIGEST_ADD, *params)
def merge(self, toKey, fromKey):
@@ -465,7 +465,7 @@ class CMSCommands:
>>> cmsincrby('A', ['foo'], [1])
""" # noqa
params = [key]
- self.appendItemsAndIncrements(params, items, increments)
+ self.append_items_and_increments(params, items, increments)
return self.execute_command(CMS_INCRBY, *params)
def query(self, key, *items):
@@ -487,7 +487,7 @@ class CMSCommands:
""" # noqa
params = [destKey, numKeys]
params += srcKeys
- self.appendWeights(params, weights)
+ self.append_weights(params, weights)
return self.execute_command(CMS_MERGE, *params)
def info(self, key):
diff --git a/redis/commands/graph/__init__.py b/redis/commands/graph/__init__.py
index 7b9972a..3736195 100644
--- a/redis/commands/graph/__init__.py
+++ b/redis/commands/graph/__init__.py
@@ -22,7 +22,7 @@ class Graph(GraphCommands):
self.edges = []
self._labels = [] # List of node labels.
self._properties = [] # List of properties.
- self._relationshipTypes = [] # List of relation types.
+ self._relationship_types = [] # List of relation types.
self.version = 0 # Graph version
@property
@@ -32,7 +32,7 @@ class Graph(GraphCommands):
def _clear_schema(self):
self._labels = []
self._properties = []
- self._relationshipTypes = []
+ self._relationship_types = []
def _refresh_schema(self):
self._clear_schema()
@@ -49,15 +49,15 @@ class Graph(GraphCommands):
self._labels[i] = l[0]
def _refresh_relations(self):
- rels = self.relationshipTypes()
+ rels = self.relationship_types()
# Unpack data.
- self._relationshipTypes = [None] * len(rels)
+ self._relationship_types = [None] * len(rels)
for i, r in enumerate(rels):
- self._relationshipTypes[i] = r[0]
+ self._relationship_types[i] = r[0]
def _refresh_attributes(self):
- props = self.propertyKeys()
+ props = self.property_keys()
# Unpack data.
self._properties = [None] * len(props)
@@ -91,11 +91,11 @@ class Graph(GraphCommands):
The index of the relation
"""
try:
- relationship_type = self._relationshipTypes[idx]
+ relationship_type = self._relationship_types[idx]
except IndexError:
# Refresh relationship types.
self._refresh_relations()
- relationship_type = self._relationshipTypes[idx]
+ relationship_type = self._relationship_types[idx]
return relationship_type
def get_property(self, idx):
@@ -155,8 +155,8 @@ class Graph(GraphCommands):
def labels(self):
return self.call_procedure("db.labels", read_only=True).result_set
- def relationshipTypes(self):
+ def relationship_types(self):
return self.call_procedure("db.relationshipTypes", read_only=True).result_set
- def propertyKeys(self):
+ def property_keys(self):
return self.call_procedure("db.propertyKeys", read_only=True).result_set
diff --git a/redis/commands/graph/edge.py b/redis/commands/graph/edge.py
index b334293..b0141d9 100644
--- a/redis/commands/graph/edge.py
+++ b/redis/commands/graph/edge.py
@@ -22,7 +22,7 @@ class Edge:
self.src_node = src_node
self.dest_node = dest_node
- def toString(self):
+ def to_string(self):
res = ""
if self.properties:
props = ",".join(
diff --git a/redis/commands/graph/node.py b/redis/commands/graph/node.py
index 47e4eeb..c5f8429 100644
--- a/redis/commands/graph/node.py
+++ b/redis/commands/graph/node.py
@@ -37,7 +37,7 @@ class Node:
self.properties = properties or {}
- def toString(self):
+ def to_string(self):
res = ""
if self.properties:
props = ",".join(
diff --git a/redis/commands/graph/query_result.py b/redis/commands/graph/query_result.py
index e9d9f4d..644ac5a 100644
--- a/redis/commands/graph/query_result.py
+++ b/redis/commands/graph/query_result.py
@@ -292,9 +292,9 @@ class QueryResult:
# record = []
# for idx, cell in enumerate(row):
# if type(cell) is Node:
- # record.append(cell.toString())
+ # record.append(cell.to_string())
# elif type(cell) is Edge:
- # record.append(cell.toString())
+ # record.append(cell.to_string())
# else:
# record.append(cell)
# tbl.add_row(record)
diff --git a/redis/commands/helpers.py b/redis/commands/helpers.py
index afb4f9f..2b873e3 100644
--- a/redis/commands/helpers.py
+++ b/redis/commands/helpers.py
@@ -117,7 +117,7 @@ def quote_string(v):
return f'"{v}"'
-def decodeDictKeys(obj):
+def decode_dict_keys(obj):
"""Decode the keys of the given dictionary with utf-8."""
newobj = copy.copy(obj)
for k in obj.keys():
diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py
index a132b8e..03ab0c4 100644
--- a/redis/commands/json/commands.py
+++ b/redis/commands/json/commands.py
@@ -12,7 +12,7 @@ from .path import Path
class JSONCommands:
"""json commands."""
- def arrappend(self, name, path=Path.rootPath(), *args):
+ def arrappend(self, name, path=Path.root_path(), *args):
"""Append the objects ``args`` to the array under the
``path` in key ``name``.
@@ -48,7 +48,7 @@ class JSONCommands:
pieces.append(self._encode(o))
return self.execute_command("JSON.ARRINSERT", *pieces)
- def arrlen(self, name, path=Path.rootPath()):
+ def arrlen(self, name, path=Path.root_path()):
"""Return the length of the array JSON value under ``path``
at key``name``.
@@ -56,7 +56,7 @@ class JSONCommands:
""" # noqa
return self.execute_command("JSON.ARRLEN", name, str(path))
- def arrpop(self, name, path=Path.rootPath(), index=-1):
+ def arrpop(self, name, path=Path.root_path(), index=-1):
"""Pop the element at ``index`` in the array JSON value under
``path`` at key ``name``.
@@ -72,21 +72,21 @@ class JSONCommands:
""" # noqa
return self.execute_command("JSON.ARRTRIM", name, str(path), start, stop)
- def type(self, name, path=Path.rootPath()):
+ def type(self, name, path=Path.root_path()):
"""Get the type of the JSON value under ``path`` from key ``name``.
For more information: https://oss.redis.com/redisjson/commands/#jsontype
""" # noqa
return self.execute_command("JSON.TYPE", name, str(path))
- def resp(self, name, path=Path.rootPath()):
+ def resp(self, name, path=Path.root_path()):
"""Return the JSON value under ``path`` at key ``name``.
For more information: https://oss.redis.com/redisjson/commands/#jsonresp
""" # noqa
return self.execute_command("JSON.RESP", name, str(path))
- def objkeys(self, name, path=Path.rootPath()):
+ def objkeys(self, name, path=Path.root_path()):
"""Return the key names in the dictionary JSON value under ``path`` at
key ``name``.
@@ -94,7 +94,7 @@ class JSONCommands:
""" # noqa
return self.execute_command("JSON.OBJKEYS", name, str(path))
- def objlen(self, name, path=Path.rootPath()):
+ def objlen(self, name, path=Path.root_path()):
"""Return the length of the dictionary JSON value under ``path`` at key
``name``.
@@ -123,7 +123,7 @@ class JSONCommands:
"JSON.NUMMULTBY", name, str(path), self._encode(number)
)
- def clear(self, name, path=Path.rootPath()):
+ def clear(self, name, path=Path.root_path()):
"""
Empty arrays and objects (to have zero slots/keys without deleting the
array/object).
@@ -135,7 +135,7 @@ class JSONCommands:
""" # noqa
return self.execute_command("JSON.CLEAR", name, str(path))
- def delete(self, key, path=Path.rootPath()):
+ def delete(self, key, path=Path.root_path()):
"""Delete the JSON value stored at key ``key`` under ``path``.
For more information: https://oss.redis.com/redisjson/commands/#jsondel
@@ -160,7 +160,7 @@ class JSONCommands:
pieces.append("noescape")
if len(args) == 0:
- pieces.append(Path.rootPath())
+ pieces.append(Path.root_path())
else:
for p in args:
@@ -275,7 +275,7 @@ class JSONCommands:
pieces.append(str(path))
return self.execute_command("JSON.STRLEN", *pieces)
- def toggle(self, name, path=Path.rootPath()):
+ def toggle(self, name, path=Path.root_path()):
"""Toggle boolean value under ``path`` at key ``name``.
returning the new value.
@@ -283,17 +283,17 @@ class JSONCommands:
""" # noqa
return self.execute_command("JSON.TOGGLE", name, str(path))
- def strappend(self, name, value, path=Path.rootPath()):
+ def strappend(self, name, value, path=Path.root_path()):
"""Append to the string JSON value. If two options are specified after
the key name, the path is determined to be the first. If a single
- option is passed, then the rootpath (i.e Path.rootPath()) is used.
+ option is passed, then the root_path (i.e Path.root_path()) is used.
For more information: https://oss.redis.com/redisjson/commands/#jsonstrappend
""" # noqa
pieces = [name, str(path), self._encode(value)]
return self.execute_command("JSON.STRAPPEND", *pieces)
- def debug(self, subcommand, key=None, path=Path.rootPath()):
+ def debug(self, subcommand, key=None, path=Path.root_path()):
"""Return the memory usage in bytes of a value under ``path`` from
key ``name``.
diff --git a/redis/commands/json/path.py b/redis/commands/json/path.py
index f0a413a..bfb0ab2 100644
--- a/redis/commands/json/path.py
+++ b/redis/commands/json/path.py
@@ -4,7 +4,7 @@ class Path:
strPath = ""
@staticmethod
- def rootPath():
+ def root_path():
"""Return the root path's string representation."""
return "."
diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py
index 3f768ab..94edea1 100644
--- a/redis/commands/search/commands.py
+++ b/redis/commands/search/commands.py
@@ -447,9 +447,9 @@ class SearchCommands:
raise ValueError("Bad query", query)
raw = self.execute_command(*cmd)
- return self._get_AggregateResult(raw, query, has_cursor)
+ return self._get_aggregate_result(raw, query, has_cursor)
- def _get_AggregateResult(self, raw, query, has_cursor):
+ def _get_aggregate_result(self, raw, query, has_cursor):
if has_cursor:
if isinstance(query, Cursor):
query.cid = raw[1]
@@ -499,7 +499,7 @@ class SearchCommands:
res = self.execute_command(*cmd)
if isinstance(query, AggregateRequest):
- result = self._get_AggregateResult(res[0], query, query._cursor)
+ result = self._get_aggregate_result(res[0], query, query._cursor)
else:
result = Result(
res[0],
diff --git a/redis/commands/search/indexDefinition.py b/redis/commands/search/indexDefinition.py
index 0c7a3b0..a668e85 100644
--- a/redis/commands/search/indexDefinition.py
+++ b/redis/commands/search/indexDefinition.py
@@ -24,14 +24,14 @@ class IndexDefinition:
index_type=None,
):
self.args = []
- self._appendIndexType(index_type)
- self._appendPrefix(prefix)
- self._appendFilter(filter)
- self._appendLanguage(language_field, language)
- self._appendScore(score_field, score)
- self._appendPayload(payload_field)
+ self._append_index_type(index_type)
+ self._append_prefix(prefix)
+ self._append_filter(filter)
+ self._append_language(language_field, language)
+ self._append_score(score_field, score)
+ self._append_payload(payload_field)
- def _appendIndexType(self, index_type):
+ def _append_index_type(self, index_type):
"""Append `ON HASH` or `ON JSON` according to the enum."""
if index_type is IndexType.HASH:
self.args.extend(["ON", "HASH"])
@@ -40,7 +40,7 @@ class IndexDefinition:
elif index_type is not None:
raise RuntimeError(f"index_type must be one of {list(IndexType)}")
- def _appendPrefix(self, prefix):
+ def _append_prefix(self, prefix):
"""Append PREFIX."""
if len(prefix) > 0:
self.args.append("PREFIX")
@@ -48,13 +48,13 @@ class IndexDefinition:
for p in prefix:
self.args.append(p)
- def _appendFilter(self, filter):
+ def _append_filter(self, filter):
"""Append FILTER."""
if filter is not None:
self.args.append("FILTER")
self.args.append(filter)
- def _appendLanguage(self, language_field, language):
+ def _append_language(self, language_field, language):
"""Append LANGUAGE_FIELD and LANGUAGE."""
if language_field is not None:
self.args.append("LANGUAGE_FIELD")
@@ -63,7 +63,7 @@ class IndexDefinition:
self.args.append("LANGUAGE")
self.args.append(language)
- def _appendScore(self, score_field, score):
+ def _append_score(self, score_field, score):
"""Append SCORE_FIELD and SCORE."""
if score_field is not None:
self.args.append("SCORE_FIELD")
@@ -72,7 +72,7 @@ class IndexDefinition:
self.args.append("SCORE")
self.args.append(score)
- def _appendPayload(self, payload_field):
+ def _append_payload(self, payload_field):
"""Append PAYLOAD_FIELD."""
if payload_field is not None:
self.args.append("PAYLOAD_FIELD")
diff --git a/redis/commands/timeseries/commands.py b/redis/commands/timeseries/commands.py
index c86e0b9..3a30c24 100644
--- a/redis/commands/timeseries/commands.py
+++ b/redis/commands/timeseries/commands.py
@@ -66,11 +66,11 @@ class TimeSeriesCommands:
chunk_size = kwargs.get("chunk_size", None)
duplicate_policy = kwargs.get("duplicate_policy", None)
params = [key]
- self._appendRetention(params, retention_msecs)
- self._appendUncompressed(params, uncompressed)
- self._appendChunkSize(params, chunk_size)
- self._appendDuplicatePolicy(params, CREATE_CMD, duplicate_policy)
- self._appendLabels(params, labels)
+ self._append_retention(params, retention_msecs)
+ self._append_uncompressed(params, uncompressed)
+ self._append_chunk_size(params, chunk_size)
+ self._append_duplicate_policy(params, CREATE_CMD, duplicate_policy)
+ self._append_labels(params, labels)
return self.execute_command(CREATE_CMD, *params)
@@ -87,9 +87,9 @@ class TimeSeriesCommands:
labels = kwargs.get("labels", {})
duplicate_policy = kwargs.get("duplicate_policy", None)
params = [key]
- self._appendRetention(params, retention_msecs)
- self._appendDuplicatePolicy(params, ALTER_CMD, duplicate_policy)
- self._appendLabels(params, labels)
+ self._append_retention(params, retention_msecs)
+ self._append_duplicate_policy(params, ALTER_CMD, duplicate_policy)
+ self._append_labels(params, labels)
return self.execute_command(ALTER_CMD, *params)
@@ -137,11 +137,11 @@ class TimeSeriesCommands:
chunk_size = kwargs.get("chunk_size", None)
duplicate_policy = kwargs.get("duplicate_policy", None)
params = [key, timestamp, value]
- self._appendRetention(params, retention_msecs)
- self._appendUncompressed(params, uncompressed)
- self._appendChunkSize(params, chunk_size)
- self._appendDuplicatePolicy(params, ADD_CMD, duplicate_policy)
- self._appendLabels(params, labels)
+ self._append_retention(params, retention_msecs)
+ self._append_uncompressed(params, uncompressed)
+ self._append_chunk_size(params, chunk_size)
+ self._append_duplicate_policy(params, ADD_CMD, duplicate_policy)
+ self._append_labels(params, labels)
return self.execute_command(ADD_CMD, *params)
@@ -197,11 +197,11 @@ class TimeSeriesCommands:
labels = kwargs.get("labels", {})
chunk_size = kwargs.get("chunk_size", None)
params = [key, value]
- self._appendTimestamp(params, timestamp)
- self._appendRetention(params, retention_msecs)
- self._appendUncompressed(params, uncompressed)
- self._appendChunkSize(params, chunk_size)
- self._appendLabels(params, labels)
+ self._append_timestamp(params, timestamp)
+ self._append_retention(params, retention_msecs)
+ self._append_uncompressed(params, uncompressed)
+ self._append_chunk_size(params, chunk_size)
+ self._append_labels(params, labels)
return self.execute_command(INCRBY_CMD, *params)
@@ -245,11 +245,11 @@ class TimeSeriesCommands:
labels = kwargs.get("labels", {})
chunk_size = kwargs.get("chunk_size", None)
params = [key, value]
- self._appendTimestamp(params, timestamp)
- self._appendRetention(params, retention_msecs)
- self._appendUncompressed(params, uncompressed)
- self._appendChunkSize(params, chunk_size)
- self._appendLabels(params, labels)
+ self._append_timestamp(params, timestamp)
+ self._append_retention(params, retention_msecs)
+ self._append_uncompressed(params, uncompressed)
+ self._append_chunk_size(params, chunk_size)
+ self._append_labels(params, labels)
return self.execute_command(DECRBY_CMD, *params)
@@ -285,7 +285,7 @@ class TimeSeriesCommands:
For more information: https://oss.redis.com/redistimeseries/master/commands/#tscreaterule
""" # noqa
params = [source_key, dest_key]
- self._appendAggregation(params, aggregation_type, bucket_size_msec)
+ self._append_aggregation(params, aggregation_type, bucket_size_msec)
return self.execute_command(CREATERULE_CMD, *params)
@@ -313,11 +313,11 @@ class TimeSeriesCommands:
):
"""Create TS.RANGE and TS.REVRANGE arguments."""
params = [key, from_time, to_time]
- self._appendFilerByTs(params, filter_by_ts)
- self._appendFilerByValue(params, filter_by_min_value, filter_by_max_value)
- self._appendCount(params, count)
- self._appendAlign(params, align)
- self._appendAggregation(params, aggregation_type, bucket_size_msec)
+ self._append_filer_by_ts(params, filter_by_ts)
+ self._append_filer_by_value(params, filter_by_min_value, filter_by_max_value)
+ self._append_count(params, count)
+ self._append_align(params, align)
+ self._append_aggregation(params, aggregation_type, bucket_size_msec)
return params
@@ -459,15 +459,15 @@ class TimeSeriesCommands:
):
"""Create TS.MRANGE and TS.MREVRANGE arguments."""
params = [from_time, to_time]
- self._appendFilerByTs(params, filter_by_ts)
- self._appendFilerByValue(params, filter_by_min_value, filter_by_max_value)
- self._appendCount(params, count)
- self._appendAlign(params, align)
- self._appendAggregation(params, aggregation_type, bucket_size_msec)
- self._appendWithLabels(params, with_labels, select_labels)
+ self._append_filer_by_ts(params, filter_by_ts)
+ self._append_filer_by_value(params, filter_by_min_value, filter_by_max_value)
+ self._append_count(params, count)
+ self._append_align(params, align)
+ self._append_aggregation(params, aggregation_type, bucket_size_msec)
+ self._append_with_labels(params, with_labels, select_labels)
params.extend(["FILTER"])
params += filters
- self._appendGroupbyReduce(params, groupby, reduce)
+ self._append_groupby_reduce(params, groupby, reduce)
return params
def mrange(
@@ -653,7 +653,7 @@ class TimeSeriesCommands:
For more information: https://oss.redis.com/redistimeseries/master/commands/#tsmget
""" # noqa
params = []
- self._appendWithLabels(params, with_labels)
+ self._append_with_labels(params, with_labels)
params.extend(["FILTER"])
params += filters
return self.execute_command(MGET_CMD, *params)
@@ -675,13 +675,13 @@ class TimeSeriesCommands:
return self.execute_command(QUERYINDEX_CMD, *filters)
@staticmethod
- def _appendUncompressed(params, uncompressed):
+ def _append_uncompressed(params, uncompressed):
"""Append UNCOMPRESSED tag to params."""
if uncompressed:
params.extend(["UNCOMPRESSED"])
@staticmethod
- def _appendWithLabels(params, with_labels, select_labels=None):
+ def _append_with_labels(params, with_labels, select_labels=None):
"""Append labels behavior to params."""
if with_labels and select_labels:
raise DataError(
@@ -694,19 +694,19 @@ class TimeSeriesCommands:
params.extend(["SELECTED_LABELS", *select_labels])
@staticmethod
- def _appendGroupbyReduce(params, groupby, reduce):
+ def _append_groupby_reduce(params, groupby, reduce):
"""Append GROUPBY REDUCE property to params."""
if groupby is not None and reduce is not None:
params.extend(["GROUPBY", groupby, "REDUCE", reduce.upper()])
@staticmethod
- def _appendRetention(params, retention):
+ def _append_retention(params, retention):
"""Append RETENTION property to params."""
if retention is not None:
params.extend(["RETENTION", retention])
@staticmethod
- def _appendLabels(params, labels):
+ def _append_labels(params, labels):
"""Append LABELS property to params."""
if labels:
params.append("LABELS")
@@ -714,38 +714,38 @@ class TimeSeriesCommands:
params.extend([k, v])
@staticmethod
- def _appendCount(params, count):
+ def _append_count(params, count):
"""Append COUNT property to params."""
if count is not None:
params.extend(["COUNT", count])
@staticmethod
- def _appendTimestamp(params, timestamp):
+ def _append_timestamp(params, timestamp):
"""Append TIMESTAMP property to params."""
if timestamp is not None:
params.extend(["TIMESTAMP", timestamp])
@staticmethod
- def _appendAlign(params, align):
+ def _append_align(params, align):
"""Append ALIGN property to params."""
if align is not None:
params.extend(["ALIGN", align])
@staticmethod
- def _appendAggregation(params, aggregation_type, bucket_size_msec):
+ def _append_aggregation(params, aggregation_type, bucket_size_msec):
"""Append AGGREGATION property to params."""
if aggregation_type is not None:
params.append("AGGREGATION")
params.extend([aggregation_type, bucket_size_msec])
@staticmethod
- def _appendChunkSize(params, chunk_size):
+ def _append_chunk_size(params, chunk_size):
"""Append CHUNK_SIZE property to params."""
if chunk_size is not None:
params.extend(["CHUNK_SIZE", chunk_size])
@staticmethod
- def _appendDuplicatePolicy(params, command, duplicate_policy):
+ def _append_duplicate_policy(params, command, duplicate_policy):
"""Append DUPLICATE_POLICY property to params on CREATE
and ON_DUPLICATE on ADD.
"""
@@ -756,13 +756,13 @@ class TimeSeriesCommands:
params.extend(["DUPLICATE_POLICY", duplicate_policy])
@staticmethod
- def _appendFilerByTs(params, ts_list):
+ def _append_filer_by_ts(params, ts_list):
"""Append FILTER_BY_TS property to params."""
if ts_list is not None:
params.extend(["FILTER_BY_TS", *ts_list])
@staticmethod
- def _appendFilerByValue(params, min_value, max_value):
+ def _append_filer_by_value(params, min_value, max_value):
"""Append FILTER_BY_VALUE property to params."""
if min_value is not None and max_value is not None:
params.extend(["FILTER_BY_VALUE", min_value, max_value])