MCPcopy
hub / github.com/redis/redis-py / __mrange_params

Method __mrange_params

redis/commands/timeseries/commands.py:996–1038  ·  view source on GitHub ↗

Create TS.MRANGE and TS.MREVRANGE arguments.

(
        self,
        aggregation_type: str | list[str] | None,
        bucket_size_msec: int | None,
        count: int | None,
        filters: List[str],
        from_time: int | str,
        to_time: int | str,
        with_labels: bool | None,
        filter_by_ts: List[int] | None,
        filter_by_min_value: int | None,
        filter_by_max_value: int | None,
        groupby: str | None,
        reduce: str | None,
        select_labels: List[str] | None,
        align: int | str | None,
        latest: bool | None,
        bucket_timestamp: str | None,
        empty: bool | None,
    )

Source from the content-addressed store, hash-verified

994 return self.execute_command(REVRANGE_CMD, *params, keys=[key])
995
996 def __mrange_params(
997 self,
998 aggregation_type: str | list[str] | None,
999 bucket_size_msec: int | None,
1000 count: int | None,
1001 filters: List[str],
1002 from_time: int | str,
1003 to_time: int | str,
1004 with_labels: bool | None,
1005 filter_by_ts: List[int] | None,
1006 filter_by_min_value: int | None,
1007 filter_by_max_value: int | None,
1008 groupby: str | None,
1009 reduce: str | None,
1010 select_labels: List[str] | None,
1011 align: int | str | None,
1012 latest: bool | None,
1013 bucket_timestamp: str | None,
1014 empty: bool | None,
1015 ):
1016 """Create TS.MRANGE and TS.MREVRANGE arguments."""
1017 if (
1018 groupby is not None
1019 and isinstance(aggregation_type, list)
1020 and len(aggregation_type) > 1
1021 ):
1022 raise DataError(
1023 "GROUPBY is not allowed when multiple aggregators are specified"
1024 )
1025 params: list[EncodableT] = [from_time, to_time]
1026 self._append_latest(params, latest)
1027 self._append_filer_by_ts(params, filter_by_ts)
1028 self._append_filer_by_value(params, filter_by_min_value, filter_by_max_value)
1029 self._append_with_labels(params, with_labels, select_labels)
1030 self._append_count(params, count)
1031 self._append_align(params, align)
1032 self._append_aggregation(params, aggregation_type, bucket_size_msec)
1033 self._append_bucket_timestamp(params, bucket_timestamp)
1034 self._append_empty(params, empty)
1035 params.extend(["FILTER"])
1036 params += filters
1037 self._append_groupby_reduce(params, groupby, reduce)
1038 return params
1039
1040 @overload
1041 def mrange(

Callers 2

mrangeMethod · 0.95
mrevrangeMethod · 0.95

Calls 12

_append_latestMethod · 0.95
_append_filer_by_tsMethod · 0.95
_append_with_labelsMethod · 0.95
_append_countMethod · 0.95
_append_alignMethod · 0.95
_append_aggregationMethod · 0.95
_append_emptyMethod · 0.95
DataErrorClass · 0.90
extendMethod · 0.45

Tested by

no test coverage detected