
    +h                         d dl mZmZmZmZmZ d dlmZ d dlm	Z	m
Z
 dZdZdZdZdZd	Zd
ZdZdZdZdZdZdZdZdZdZdZ G d d      Zy)    )DictListOptionalTupleUnion)	DataError)KeyTNumberTS.ADDzTS.ALTERzTS.CREATERULEz	TS.CREATEz	TS.DECRBYzTS.DELETERULEzTS.DELzTS.GETz	TS.INCRBYzTS.INFOzTS.MADDzTS.MGETz	TS.MRANGEzTS.MREVRANGEzTS.QUERYINDEXzTS.RANGEzTS.REVRANGEc            $       
   e Zd ZdZ	 	 	 	 	 dIdedee   dee   deee	e	f      dee   dee	   fd	Z
	 	 	 	 dJdedee   deee	e	f      dee   dee	   f
d
Z	 	 	 	 	 dIdedeee	f   dedee   dee   deee	e	f      dee   dee	   fdZdeeeeee	f   ef      fdZ	 	 	 	 	 dKdededeeee	f      dee   dee   deee	e	f      dee   fdZ	 	 	 	 	 dKdededeeee	f      dee   dee   deee	e	f      dee   fdZdededefdZ	 dLdedede	dedee   f
dZdedefdZdedeee	f   deee	f   dee   dee	   dee   deee      dee   dee   d eeee	f      d!ee   d"ee	   d#ee   fd$Z	 	 	 	 	 	 	 	 	 	 dMdedeee	f   deee	f   dee   dee	   dee   deee      dee   dee   d eeee	f      d!ee   d"ee	   d#ee   fd%Z	 	 	 	 	 	 	 	 	 	 dMdedeee	f   deee	f   dee   dee	   dee   deee      dee   dee   d eeee	f      d!ee   d"ee	   d#ee   fd&Zdee	   dee   dee   d'ee	   deee	f   deee	f   d(ee   deee      dee   dee   d)ee	   d*ee	   d+eee	      d eeee	f      d!ee   d"ee	   d#ee   f"d,Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dNdeee	f   deee	f   d'ee	   dee   dee	   dee   d(ee   deee      dee   dee   d)ee	   d*ee	   d+eee	      d eeee	f      d!ee   d"ee	   d#ee   f"d-Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dNdeee	f   deee	f   d'ee	   dee   dee	   dee   d(ee   deee      dee   dee   d)ee	   d*ee	   d+eee	      d eeee	f      d!ee   d"ee	   d#ee   f"d.ZdOded!ee   fd/Z	 	 	 dPd'ee	   d(ee   d+eee	      d!ee   fd0Zdefd1Zd'ee	   fd2Z e!d3ee	   dee   fd4       Z"e!d3ee	   d(ee   d+eee	      fd5       Z#e!d3ee	   d)ee	   d*ee	   fd6       Z$e!d3ee	   d7ee   fd8       Z%e!d3ee	   deee	      fd9       Z&e!d3ee	   dee   fd:       Z'e!d3ee	   dee   fd;       Z(e!d3ee	   d eeee	f      fd<       Z)e!d3ee	   dee	   dee   fd=       Z*e!d3ee	   dee   fd>       Z+e!d3ee	   d?ee	   dee	   fd@       Z,e!d3ee	   dAeee      fdB       Z-e!d3ee	   dCee   dDee   fdE       Z.e!d3ee	   d!ee   fdF       Z/e!d3ee	   d"ee	   fdG       Z0e!d3ee	   d#ee   fdH       Z1y)QTimeSeriesCommandszRedisTimeSeries Commands.Nkeyretention_msecsuncompressedlabels
chunk_sizeduplicate_policyc                     |g}| j                  ||       | j                  ||       | j                  ||       | j                  |t        |       | j                  ||        | j                  t        g| S )a  
        Create a new time-series.

        Args:

        key:
            time-series key
        retention_msecs:
            Maximum age for samples compared to highest reported timestamp (in milliseconds).
            If None or 0 is passed then  the series is not trimmed at all.
        uncompressed:
            Changes data storage from compressed (by default) to uncompressed
        labels:
            Set of label-value pairs that represent metadata labels of the key.
        chunk_size:
            Memory size, in bytes, allocated for each data chunk.
            Must be a multiple of 8 in the range [128 .. 1048576].
        duplicate_policy:
            Policy for handling multiple samples with identical timestamps.
            Can be one of:
            - 'block': an error will occur for any out of order sample.
            - 'first': ignore the new value.
            - '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.

        For more information: https://redis.io/commands/ts.create/
        )_append_retention_append_uncompressed_append_chunk_size_append_duplicate_policy
CREATE_CMD_append_labelsexecute_command)selfr   r   r   r   r   r   paramss           U/var/www/html/venv/lib/python3.12/site-packages/redis/commands/timeseries/commands.pycreatezTimeSeriesCommands.create   sw    J v7!!&,7
3%%fj:JKFF+#t##J888    c                     |g}| j                  ||       | j                  ||       | j                  |t        |       | j	                  ||        | j
                  t        g| S )az  
        Update the retention, chunk size, duplicate policy, and labels of an existing
        time series.

        Args:

        key:
            time-series key
        retention_msecs:
            Maximum retention period, compared to maximal existing timestamp (in milliseconds).
            If None or 0 is passed then  the series is not trimmed at all.
        labels:
            Set of label-value pairs that represent metadata labels of the key.
        chunk_size:
            Memory size, in bytes, allocated for each data chunk.
            Must be a multiple of 8 in the range [128 .. 1048576].
        duplicate_policy:
            Policy for handling multiple samples with identical timestamps.
            Can be one of:
            - 'block': an error will occur for any out of order sample.
            - 'first': ignore the new value.
            - '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.

        For more information: https://redis.io/commands/ts.alter/
        )r   r   r   	ALTER_CMDr   r   )r   r   r   r   r   r   r   s          r   alterzTimeSeriesCommands.alterJ   sg    F v7
3%%fi9IJFF+#t##I777r    	timestampvaluec	                     |||g}	| j                  |	|       | j                  |	|       | j                  |	|       | j                  |	t        |       | j                  |	|        | j                  t        g|	 S )aj  
        Append (or create and append) a new sample to a time series.

        Args:

        key:
            time-series key
        timestamp:
            Timestamp of the sample. * can be used for automatic timestamp (using the system clock).
        value:
            Numeric data value of the sample
        retention_msecs:
            Maximum retention period, compared to maximal existing timestamp (in milliseconds).
            If None or 0 is passed then  the series is not trimmed at all.
        uncompressed:
            Changes data storage from compressed (by default) to uncompressed
        labels:
            Set of label-value pairs that represent metadata labels of the key.
        chunk_size:
            Memory size, in bytes, allocated for each data chunk.
            Must be a multiple of 8 in the range [128 .. 1048576].
        duplicate_policy:
            Policy for handling multiple samples with identical timestamps.
            Can be one of:
            - 'block': an error will occur for any out of order sample.
            - 'first': ignore the new value.
            - '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.

        For more information: https://redis.io/commands/ts.add/
        )r   r   r   r   ADD_CMDr   r   )
r   r   r$   r%   r   r   r   r   r   r   s
             r   addzTimeSeriesCommands.addu   s|    V y%(v7!!&,7
3%%fg7GHFF+#t##G5f55r    
ktv_tuplesc                 d    g }|D ]  }|j                  |         | j                  t        g| S )a-  
        Append (or create and append) a new `value` to series
        `key` with `timestamp`.
        Expects a list of `tuples` as (`key`,`timestamp`, `value`).
        Return value is an array with timestamps of insertions.

        For more information: https://redis.io/commands/ts.madd/
        )extendr   MADD_CMD)r   r)   r   ktvs       r   maddzTimeSeriesCommands.madd   s>      	CMM#	 $t##H6v66r    c                     ||g}| j                  ||       | j                  ||       | j                  ||       | j                  ||       | j	                  ||        | j
                  t        g| S )a  
        Increment (or create an time-series and increment) the latest sample's of a series.
        This command can be used as a counter or gauge that automatically gets history as a time series.

        Args:

        key:
            time-series key
        value:
            Numeric data value of the sample
        timestamp:
            Timestamp of the sample. * can be used for automatic timestamp (using the system clock).
        retention_msecs:
            Maximum age for samples compared to last event time (in milliseconds).
            If None or 0 is passed then  the series is not trimmed at all.
        uncompressed:
            Changes data storage from compressed (by default) to uncompressed
        labels:
            Set of label-value pairs that represent metadata labels of the key.
        chunk_size:
            Memory size, in bytes, allocated for each data chunk.

        For more information: https://redis.io/commands/ts.incrby/
        )_append_timestampr   r   r   r   r   
INCRBY_CMD	r   r   r%   r$   r   r   r   r   r   s	            r   incrbyzTimeSeriesCommands.incrby   v    D uvy1v7!!&,7
3FF+#t##J888r    c                     ||g}| j                  ||       | j                  ||       | j                  ||       | j                  ||       | j	                  ||        | j
                  t        g| S )a  
        Decrement (or create an time-series and decrement) the latest sample's of a series.
        This command can be used as a counter or gauge that automatically gets history as a time series.

        Args:

        key:
            time-series key
        value:
            Numeric data value of the sample
        timestamp:
            Timestamp of the sample. * can be used for automatic timestamp (using the system clock).
        retention_msecs:
            Maximum age for samples compared to last event time (in milliseconds).
            If None or 0 is passed then  the series is not trimmed at all.
        uncompressed:
            Changes data storage from compressed (by default) to uncompressed
        labels:
            Set of label-value pairs that represent metadata labels of the key.
        chunk_size:
            Memory size, in bytes, allocated for each data chunk.

        For more information: https://redis.io/commands/ts.decrby/
        )r0   r   r   r   r   r   
DECRBY_CMDr2   s	            r   decrbyzTimeSeriesCommands.decrby   r4   r    	from_timeto_timec                 2    | j                  t        |||      S )aY  
        Delete all samples between two timestamps for a given time series.

        Args:

        key:
            time-series key.
        from_time:
            Start timestamp for the range deletion.
        to_time:
            End timestamp for the range deletion.

        For more information: https://redis.io/commands/ts.del/
        )r   DEL_CMD)r   r   r8   r9   s       r   deletezTimeSeriesCommands.delete  s     ##GS)WEEr    
source_keydest_keyaggregation_typebucket_size_msecalign_timestampc                     ||g}| j                  |||       ||j                  |        | j                  t        g| S )a  
        Create a compaction rule from values added to `source_key` into `dest_key`.

        Args:

        source_key:
            Key name for source time series
        dest_key:
            Key name for destination (compacted) time series
        aggregation_type:
            Aggregation type: One of the following:
            [`avg`, `sum`, `min`, `max`, `range`, `count`, `first`, `last`, `std.p`,
            `std.s`, `var.p`, `var.s`, `twa`]
        bucket_size_msec:
            Duration of each bucket, in milliseconds
        align_timestamp:
            Assure that there is a bucket that starts at exactly align_timestamp and
            align all other buckets accordingly.

        For more information: https://redis.io/commands/ts.createrule/
        )_append_aggregationappendr   CREATERULE_CMD)r   r=   r>   r?   r@   rA   r   s          r   
createrulezTimeSeriesCommands.createrule  sL    : h'  )9;KL&MM/*#t##N<V<<r    c                 0    | j                  t        ||      S )z
        Delete a compaction rule from `source_key` to `dest_key`..

        For more information: https://redis.io/commands/ts.deleterule/
        )r   DELETERULE_CMD)r   r=   r>   s      r   
deleterulezTimeSeriesCommands.deleteruleC  s     ##NJIIr    countfilter_by_tsfilter_by_min_valuefilter_by_max_valuealignlatestbucket_timestampemptyc                 4   |||g}| j                  ||       | j                  ||       | j                  |||	       | j                  ||       | j	                  ||
       | j                  |||       | j                  ||       | j                  ||       |S )z*Create TS.RANGE and TS.REVRANGE arguments.)_append_latest_append_filer_by_ts_append_filer_by_value_append_count_append_alignrC   _append_bucket_timestamp_append_emptyr   r   r8   r9   rJ   r?   r@   rK   rL   rM   rN   rO   rP   rQ   r   s                  r   __range_paramsz!TimeSeriesCommands.__range_paramsK  s    " y'*FF+  6##F,?ATU65)65)  )9;KL%%f.>?65)r    c                 j    | j                  |||||||||	|
|||      } | j                  t        g| S )a  
        Query a range in forward direction for a specific time-serie.

        Args:

        key:
            Key name for timeseries.
        from_time:
            Start timestamp for the range query. - can be used to express the minimum possible timestamp (0).
        to_time:
            End timestamp for range query, + can be used to express the maximum possible timestamp.
        count:
            Limits the number of returned samples.
        aggregation_type:
            Optional aggregation type. Can be one of [`avg`, `sum`, `min`, `max`,
            `range`, `count`, `first`, `last`, `std.p`, `std.s`, `var.p`, `var.s`, `twa`]
        bucket_size_msec:
            Time bucket for aggregation in milliseconds.
        filter_by_ts:
            List of timestamps to filter the result by specific timestamps.
        filter_by_min_value:
            Filter result by minimum value (must mention also filter by_max_value).
        filter_by_max_value:
            Filter result by maximum value (must mention also filter by_min_value).
        align:
            Timestamp for alignment control for aggregation.
        latest:
            Used when a time series is a compaction, reports the compacted value of the
            latest possibly partial bucket
        bucket_timestamp:
            Controls how bucket timestamps are reported. Can be one of [`-`, `low`, `+`,
            `high`, `~`, `mid`].
        empty:
            Reports aggregations for empty buckets.

        For more information: https://redis.io/commands/ts.range/
        )!_TimeSeriesCommands__range_paramsr   	RANGE_CMDrZ   s                  r   rangezTimeSeriesCommands.rangeh  sV    j $$
 $t##I777r    c                 j    | j                  |||||||||	|
|||      } | j                  t        g| S )as  
        Query a range in reverse direction for a specific time-series.

        **Note**: This command is only available since RedisTimeSeries >= v1.4

        Args:

        key:
            Key name for timeseries.
        from_time:
            Start timestamp for the range query. - can be used to express the minimum possible timestamp (0).
        to_time:
            End timestamp for range query, + can be used to express the maximum possible timestamp.
        count:
            Limits the number of returned samples.
        aggregation_type:
            Optional aggregation type. Can be one of [`avg`, `sum`, `min`, `max`,
            `range`, `count`, `first`, `last`, `std.p`, `std.s`, `var.p`, `var.s`, `twa`]
        bucket_size_msec:
            Time bucket for aggregation in milliseconds.
        filter_by_ts:
            List of timestamps to filter the result by specific timestamps.
        filter_by_min_value:
            Filter result by minimum value (must mention also filter_by_max_value).
        filter_by_max_value:
            Filter result by maximum value (must mention also filter_by_min_value).
        align:
            Timestamp for alignment control for aggregation.
        latest:
            Used when a time series is a compaction, reports the compacted value of the
            latest possibly partial bucket
        bucket_timestamp:
            Controls how bucket timestamps are reported. Can be one of [`-`, `low`, `+`,
            `high`, `~`, `mid`].
        empty:
            Reports aggregations for empty buckets.

        For more information: https://redis.io/commands/ts.revrange/
        )r]   r   REVRANGE_CMDrZ   s                  r   revrangezTimeSeriesCommands.revrange  sV    n $$
 $t##L:6::r    filterswith_labelsgroupbyreduceselect_labelsc                    ||g}| j                  ||       | j                  ||       | j                  ||	|
       | j                  |||       | j	                  ||       | j                  ||       | j                  |||       | j                  ||       | j                  ||       |j                  dg       ||z  }| j                  |||       |S )z,Create TS.MRANGE and TS.MREVRANGE arguments.FILTER)rS   rT   rU   _append_with_labelsrV   rW   rC   rX   rY   r+   _append_groupby_reduce)r   r?   r@   rJ   rc   r8   r9   rd   rK   rL   rM   re   rf   rg   rN   rO   rP   rQ   r   s                      r   __mrange_paramsz"TimeSeriesCommands.__mrange_params  s    * W%FF+  6##F,?ATU  mD65)65)  )9;KL%%f.>?65)xj!'##FGV<r    c                 r    | j                  |||||||||	|
|||||||      } | j                  t        g| S )a<  
        Query a range across multiple time-series by filters in forward direction.

        Args:

        from_time:
            Start timestamp for the range query. `-` can be used to express the minimum possible timestamp (0).
        to_time:
            End timestamp for range query, `+` can be used to express the maximum possible timestamp.
        filters:
            filter to match the time-series labels.
        count:
            Limits the number of returned samples.
        aggregation_type:
            Optional aggregation type. Can be one of [`avg`, `sum`, `min`, `max`,
            `range`, `count`, `first`, `last`, `std.p`, `std.s`, `var.p`, `var.s`, `twa`]
        bucket_size_msec:
            Time bucket for aggregation in milliseconds.
        with_labels:
            Include in the reply all label-value pairs representing metadata labels of the time series.
        filter_by_ts:
            List of timestamps to filter the result by specific timestamps.
        filter_by_min_value:
            Filter result by minimum value (must mention also filter_by_max_value).
        filter_by_max_value:
            Filter result by maximum value (must mention also filter_by_min_value).
        groupby:
            Grouping by fields the results (must mention also reduce).
        reduce:
            Applying reducer functions on each group. Can be one of [`avg` `sum`, `min`,
            `max`, `range`, `count`, `std.p`, `std.s`, `var.p`, `var.s`].
        select_labels:
            Include in the reply only a subset of the key-value pair labels of a series.
        align:
            Timestamp for alignment control for aggregation.
        latest:
            Used when a time series is a compaction, reports the compacted
            value of the latest possibly partial bucket
        bucket_timestamp:
            Controls how bucket timestamps are reported. Can be one of [`-`, `low`, `+`,
            `high`, `~`, `mid`].
        empty:
            Reports aggregations for empty buckets.

        For more information: https://redis.io/commands/ts.mrange/
        )"_TimeSeriesCommands__mrange_paramsr   
MRANGE_CMDr   r8   r9   rc   rJ   r?   r@   rd   rK   rL   rM   re   rf   rg   rN   rO   rP   rQ   r   s                      r   mrangezTimeSeriesCommands.mrange  sb    D %%#
( $t##J888r    c                 r    | j                  |||||||||	|
|||||||      } | j                  t        g| S )a;  
        Query a range across multiple time-series by filters in reverse direction.

        Args:

        from_time:
            Start timestamp for the range query. - can be used to express the minimum possible timestamp (0).
        to_time:
            End timestamp for range query, + can be used to express the maximum possible timestamp.
        filters:
            Filter to match the time-series labels.
        count:
            Limits the number of returned samples.
        aggregation_type:
            Optional aggregation type. Can be one of [`avg`, `sum`, `min`, `max`,
            `range`, `count`, `first`, `last`, `std.p`, `std.s`, `var.p`, `var.s`, `twa`]
        bucket_size_msec:
            Time bucket for aggregation in milliseconds.
        with_labels:
            Include in the reply all label-value pairs representing metadata labels of the time series.
        filter_by_ts:
            List of timestamps to filter the result by specific timestamps.
        filter_by_min_value:
            Filter result by minimum value (must mention also filter_by_max_value).
        filter_by_max_value:
            Filter result by maximum value (must mention also filter_by_min_value).
        groupby:
            Grouping by fields the results (must mention also reduce).
        reduce:
            Applying reducer functions on each group. Can be one of [`avg` `sum`, `min`,
            `max`, `range`, `count`, `std.p`, `std.s`, `var.p`, `var.s`].
        select_labels:
            Include in the reply only a subset of the key-value pair labels of a series.
        align:
            Timestamp for alignment control for aggregation.
        latest:
            Used when a time series is a compaction, reports the compacted
            value of the latest possibly partial bucket
        bucket_timestamp:
            Controls how bucket timestamps are reported. Can be one of [`-`, `low`, `+`,
            `high`, `~`, `mid`].
        empty:
            Reports aggregations for empty buckets.

        For more information: https://redis.io/commands/ts.mrevrange/
        )rn   r   MREVRANGE_CMDrp   s                      r   	mrevrangezTimeSeriesCommands.mrevranger  sb    D %%#
( $t##M;F;;r    c                 Z    |g}| j                  ||        | j                  t        g| S )z# noqa
        Get the last sample of `key`.
        `latest` used when a time series is a compaction, reports the compacted
        value of the latest (possibly partial) bucket

        For more information: https://redis.io/commands/ts.get/
        )rS   r   GET_CMD)r   r   rO   r   s       r   getzTimeSeriesCommands.get  s3     FF+#t##G5f55r    c                     g }| j                  ||       | j                  |||       |j                  dg       ||z  } | j                  t        g| S )ao  # noqa
        Get the last samples matching the specific `filter`.

        Args:

        filters:
            Filter to match the time-series labels.
        with_labels:
            Include in the reply all label-value pairs representing metadata
            labels of the time series.
        select_labels:
            Include in the reply only a subset of the key-value pair labels of a series.
        latest:
            Used when a time series is a compaction, reports the compacted
            value of the latest possibly partial bucket

        For more information: https://redis.io/commands/ts.mget/
        ri   )rS   rj   r+   r   MGET_CMD)r   rc   rd   rg   rO   r   s         r   mgetzTimeSeriesCommands.mget  s[    2 FF+  mDxj!'#t##H6v66r    c                 .    | j                  t        |      S )zs# noqa
        Get information of `key`.

        For more information: https://redis.io/commands/ts.info/
        )r   INFO_CMD)r   r   s     r   infozTimeSeriesCommands.info  s     ##Hc22r    c                 0     | j                   t        g| S )z# noqa
        Get all time series keys matching the `filter` list.

        For more information: https://redis.io/commands/ts.queryindex/
        )r   QUERYINDEX_CMD)r   rc   s     r   
queryindexzTimeSeriesCommands.queryindex  s     $t##N=W==r    r   c                 .    |r| j                  dg       yy)z"Append UNCOMPRESSED tag to params.UNCOMPRESSEDNr+   )r   r   s     r   r   z'TimeSeriesCommands._append_uncompressed  s     MM>*+ r    c                 x    |r|rt        d      |r| j                  dg       |r| j                  dg|       yy)z!Append labels behavior to params.z:with_labels and select_labels cannot be provided together.
WITHLABELSSELECTED_LABELSN)r   r+   )r   rd   rg   s      r   rj   z&TimeSeriesCommands._append_with_labels  sI     =L  MM<.)MM,=}=> r    c                 V    |'|$| j                  d|d|j                         g       yyy)z)Append GROUPBY REDUCE property to params.NGROUPBYREDUCE)r+   upper)r   re   rf   s      r   rk   z)TimeSeriesCommands._append_groupby_reduce  s2    
 6#5MM9gxHI $6r    	retentionc                 0    || j                  d|g       yy)z$Append RETENTION property to params.N	RETENTIONr   )r   r   s     r   r   z$TimeSeriesCommands._append_retention%         MM;	23 !r    c                     |r=| j                  d       |j                         D ]  \  }}| j                  ||g        yy)z!Append LABELS property to params.LABELSN)rD   itemsr+   )r   r   kvs       r   r   z!TimeSeriesCommands._append_labels+  sA     MM(# &1q!f%& r    c                 0    || j                  d|g       yy)z Append COUNT property to params.NCOUNTr   )r   rJ   s     r   rV   z TimeSeriesCommands._append_count3        MM7E*+ r    c                 0    || j                  d|g       yy)z$Append TIMESTAMP property to params.N	TIMESTAMPr   )r   r$   s     r   r0   z$TimeSeriesCommands._append_timestamp9  r   r    c                 0    || j                  d|g       yy)z Append ALIGN property to params.NALIGNr   )r   rN   s     r   rW   z TimeSeriesCommands._append_align?  r   r    c                 2    || j                  d||g       yy)z&Append AGGREGATION property to params.NAGGREGATIONr   )r   r?   r@   s      r   rC   z&TimeSeriesCommands._append_aggregationE  s$     'MM=*:<LMN (r    c                 0    || j                  d|g       yy)z%Append CHUNK_SIZE property to params.N
CHUNK_SIZEr   )r   r   s     r   r   z%TimeSeriesCommands._append_chunk_sizeO  s      !MM<45 "r    commandc                 b    |-|dk(  r| j                  d|g       y| j                  d|g       yy)z^Append DUPLICATE_POLICY property to params on CREATE
        and ON_DUPLICATE on ADD.
        Nr   ON_DUPLICATEDUPLICATE_POLICYr   )r   r   r   s      r   r   z+TimeSeriesCommands._append_duplicate_policyU  s<     '("~/?@A13CDE	 (r    ts_listc                 2    || j                  dg|       yy)z'Append FILTER_BY_TS property to params.NFILTER_BY_TSr   )r   r   s     r   rT   z&TimeSeriesCommands._append_filer_by_tsb  s#     MM>4G45 r    	min_value	max_valuec                 8    ||| j                  d||g       yyy)z*Append FILTER_BY_VALUE property to params.NFILTER_BY_VALUEr   )r   r   r   s      r   rU   z)TimeSeriesCommands._append_filer_by_valueh  s+    
  Y%:MM,iCD &; r    c                 ,    |r| j                  d       yy)z!Append LATEST property to params.LATESTNrD   )r   rO   s     r   rS   z!TimeSeriesCommands._append_latestp  s     MM(# r    c                 0    || j                  d|g       yy)z+Append BUCKET_TIMESTAMP property to params.NBUCKETTIMESTAMPr   )r   rP   s     r   rX   z+TimeSeriesCommands._append_bucket_timestampv  s"     'MM,.>?@ (r    c                 ,    |r| j                  d       yy)z Append EMPTY property to params.EMPTYNr   )r   rQ   s     r   rY   z TimeSeriesCommands._append_empty|  s     MM'" r    )NFNNN)NNNN)NNFNN)N)
NNr   NNNNFNF)NNr   FNNNNNNNFNF)F)FNF)2__name__
__module____qualname____doc__r	   r   intboolr   strr   r#   r   r
   r(   r   r   r.   r3   r7   r<   rF   rI   r]   r_   rb   rn   rq   rt   rw   rz   r}   r   staticmethodr   rj   rk   r   r   rV   r0   rW   rC   r   r   rT   rU   rS   rX   rY    r    r   r   r      s   #
 *.',+/$(*.,9,9 "#,9 tn	,9
 c3h(,9 SM,9 #3-,9b *.+/$(*.)8)8 "#)8 c3h(	)8
 SM)8 #3-)8` *.',+/$(*.2626 c?26 	26
 "#26 tn26 c3h(26 SM26 #3-26h7tE$c3h*G$HI 7& 04)-',+/$()9)9 )9 E#s(O,	)9
 "#)9 tn)9 c3h()9 SM)9^ 04)-',+/$()9)9 )9 E#s(O,	)9
 "#)9 tn)9 c3h()9 SM)9VF$ F3 F F. *."="= "= 	"=
 "= "#"=HJT JT J c? sCx	
 } #3- #3- tCy) &c] &c] c3h(  #3- ~D  $*.*+,0-1-1+/!&*. %D8D8 c?D8 sCx	D8
 }D8 #3-D8 #3-D8 tCy)D8 &c]D8 &c]D8 c3h(D8 D8 #3-D8 ~D8V  $*.*+,0-1-1+/!&*. %F;F; c?F; sCx	F;
 }F; #3-F; #3-F; tCy)F; &c]F; &c]F; c3h(F; F; #3-F; ~F;P""3-" #3-" }	"
 c" c?" sCx" d^" tCy)" &c]" &c]" #" "  S	*" c3h("  !"" #3-#"$ ~%"R  $*.*+&+,0-1-1!% $-1+/!&*. %%V9c?V9 sCxV9 c	V9
 }V9 #3-V9 #3-V9 d^V9 tCy)V9 &c]V9 &c]V9 #V9 V9  S	*V9 c3h(V9  !V9" #3-#V9$ ~%V9z  $*.*+&+,0-1-1!% $-1+/!&*. %%V<c?V< sCxV< c	V<
 }V< #3-V< #3-V< d^V< tCy)V< &c]V< &c]V< #V< V<  S	*V< c3h(V<  !V<" #3-#V<$ ~%V<p
6t 
6Xd^ 
6 ',-1!&7c7 d^7  S	*	7
 7@3 3>$s) > ,T#Y ,htn , ,
 ?S	?d^?  S	*? ?  JS	J$,SMJ;CC=J J 4$s) 4 4 4
 &tCy &(492E & & ,d3i , , ,
 4$s) 4 4 4
 ,d3i ,sCx0I , ,
 OS	O"3-O #3-O O 649 6(3- 6 6
 
FS	
F$,SM
FEMc]
F 
F 6DI 6c8K 6 6
 ES	E&.smE@HE E $tCy $(4. $ $
 Ac Ahsm A A
 #d3i # # #r    r   N)typingr   r   r   r   r   redis.exceptionsr   redis.typingr	   r
   r'   r"   rE   r   r6   rH   r;   rv   r1   r|   r,   ry   ro   rs   r   r^   ra   r   r   r    r   <module>r      sr    5 5 & %
	 

 



 	g# g#r    