
    )Jf                         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dS )    )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	 	 	 	 	 dKdedee         dee         deee	e	f                  dee         d	ee	         fd
Z
	 	 	 	 dLdedee         deee	e	f                  dee         d	ee	         f
dZ	 	 	 	 	 dKd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	 	 	 	 	 dMd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	 	 	 	 	 dMd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	 dNd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	 	 	 	 	 	 	 	 	 	 dOd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	 	 	 	 	 	 	 	 	 	 dOd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	 	 	 	 	 	 	 	 	 	 	 	 	 	 dPd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	 	 	 	 	 	 	 	 	 	 	 	 	 	 dPd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"d0ZdQded"ee         fd1Z	 	 	 dRd)ee	         d*ee         d-eee	                  d"ee         fd2Zdefd3Zd)ee	         fd4Z e!d5ee	         dee         fd6            Z"e!d5ee	         d*ee         d-eee	                  fd7            Z#e!d5ee	         d+ee	         d,ee	         fd8            Z$e!d5ee	         d9ee         fd:            Z%e!d5ee	         deee	                  fd;            Z&e!d5ee	         dee         fd<            Z'e!d5ee	         dee         fd=            Z(e!d5ee	         d!eeee	f                  fd>            Z)e!d5ee	         dee	         dee         fd?            Z*e!d5ee	         dee         fd@            Z+e!d5ee	         dAee	         d	ee	         fdB            Z,e!d5ee	         dCeee                  fdD            Z-e!d5ee	         dEee         dFee         fdG            Z.e!d5ee	         d"ee         fdH            Z/e!d5ee	         d#ee	         fdI            Z0e!d5ee	         d$ee         fdJ            Z1dS )STimeSeriesCommandszRedisTimeSeries Commands.NFkeyretention_msecsuncompressedlabels
chunk_sizeduplicate_policyc                    |g}|                      ||           |                     ||           |                     ||           |                     |t          |           |                     ||            | j        t          g|R  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           e/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/redis/commands/timeseries/commands.pycreatezTimeSeriesCommands.create   s    J v777!!&,777
333%%fj:JKKKFF+++#t#J88888    c                     |g}|                      ||           |                     ||           |                     |t          |           |                     ||            | j        t          g|R  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   s    F v777
333%%fi9IJJJFF+++#t#I77777r    	timestampvaluec	                    |||g}	|                      |	|           |                     |	|           |                     |	|           |                     |	t          |           |                     |	|            | j        t          g|	R  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7!!&,777
333%%fg7GHHHFF+++#t#G5f5555r    
ktv_tuplesc                 `    g }|D ]}|                     |            | j        t          g|R  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   sH      	 	CMM##t#H6v6666r    c                    ||g}|                      ||           |                     ||           |                     ||           |                     ||           |                     ||            | j        t          g|R  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       D uvy111v777!!&,777
333FF+++#t#J88888r    c                    ||g}|                      ||           |                     ||           |                     ||           |                     ||           |                     ||            | j        t          g|R  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                 <    |                      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EEr    
source_keydest_keyaggregation_typebucket_size_msecalign_timestampc                     ||g}|                      |||           ||                    |            | j        t          g|R  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  s[    : h'  )9;KLLL&MM/***#t#N<V<<<<r    c                 :    |                      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IIr    countfilter_by_tsfilter_by_min_valuefilter_by_max_valuealignlatestbucket_timestampemptyc                 t   |||g}|                      ||           |                     ||           |                     |||	           |                     ||           |                     ||
           |                     |||           |                     ||           |                     ||           |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66##F,?ATUUU65)))65)))  )9;KLLL%%f.>???65)))r    r   c                 j    |                      |||||||||	|
|||          } | j        t          g|R  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  s^    j $$
 
 $t#I77777r    c                 j    |                      |||||||||	|
|||          } | j        t          g|R  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  s^    n $$
 
 $t#L:6::::r    filterswith_labelsgroupbyreduceselect_labelsc                    ||g}|                      ||           |                     ||           |                     ||	|
           |                     |||           |                     ||           |                     ||           |                     |||           |                     ||           |                     ||           |	                    dg           ||z  }| 
                    |||           |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66##F,?ATUUU  mDDD65)))65)))  )9;KLLL%%f.>???65)))xj!!!'##FGV<<<r    c                 r    |                      |||||||||	|
|||||||          } | j        t          g|R  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  sj    D %%#
 
( $t#J88888r    c                 r    |                      |||||||||	|
|||||||          } | j        t          g|R  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  sj    D %%#
 
( $t#M;F;;;;r    c                 Z    |g}|                      ||            | j        t          g|R  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  s<     FF+++#t#G5f5555r    c                     g }|                      ||           |                     |||           |                    dg           ||z  } | j        t          g|R  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  sp    2 FF+++  mDDDxj!!!'#t#H6v6666r    c                 8    |                      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22r    c                 (     | j         t          g|R  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|                      dg           dS dS )z"Append UNCOMPRESSED tag to params.UNCOMPRESSEDNr+   )r   r   s     r   r   z'TimeSeriesCommands._append_uncompressed  s1      	,MM>*+++++	, 	,r    c                     |r|rt          d          |r|                     dg           |r|                     dg|           dS dS )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  sy      	= 	L    	*MM<.))) 	?MM,=}=>>>>>	? 	?r    c                 l    |/|/|                      d|d|                                g           dS dS dS )z)Append GROUPBY REDUCE property to params.NGROUPBYREDUCE)r+   upper)r   re   rf   s      r   rk   z)TimeSeriesCommands._append_groupby_reduce  sF    
 6#5MM9gxHIIIII #5#5r    	retentionc                 <    ||                      d|g           dS dS )z$Append RETENTION property to params.N	RETENTIONr   )r   r   s     r   r   z$TimeSeriesCommands._append_retention%  /      MM;	233333 ! r    c                     |rF|                      d           |                                D ]\  }}|                     ||g           dS dS )z!Append LABELS property to params.LABELSN)rD   itemsr+   )r   r   kvs       r   r   z!TimeSeriesCommands._append_labels+  sf      	&MM(### & &1q!f%%%%	& 	&& &r    c                 <    ||                      d|g           dS dS )z Append COUNT property to params.NCOUNTr   )r   rJ   s     r   rV   z TimeSeriesCommands._append_count3  /     MM7E*+++++ r    c                 <    ||                      d|g           dS dS )z$Append TIMESTAMP property to params.N	TIMESTAMPr   )r   r$   s     r   r0   z$TimeSeriesCommands._append_timestamp9  r   r    c                 <    ||                      d|g           dS dS )z Append ALIGN property to params.NALIGNr   )r   rN   s     r   rW   z TimeSeriesCommands._append_align?  r   r    c                 >    ||                      d||g           dS dS )z&Append AGGREGATION property to params.NAGGREGATIONr   )r   r?   r@   s      r   rC   z&TimeSeriesCommands._append_aggregationE  s3     'MM=*:<LMNNNNN ('r    c                 <    ||                      d|g           dS dS )z%Append CHUNK_SIZE property to params.N
CHUNK_SIZEr   )r   r   s     r   r   z%TimeSeriesCommands._append_chunk_sizeO  s/     !MM<455555 "!r    commandc                 z    |8|dk    r|                      d|g           dS |                      d|g           dS dS )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  sZ     '(""~/?@AAAAA13CDEEEEE	 ('r    ts_listc                 >    ||                      dg|           dS dS )z'Append FILTER_BY_TS property to params.NFILTER_BY_TSr   )r   r   s     r   rT   z&TimeSeriesCommands._append_filer_by_tsb  s2     MM>4G455555 r    	min_value	max_valuec                 F    |||                      d||g           dS dS dS )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DDDD ! %:%:r    c                 8    |r|                      d           dS dS )z!Append LATEST property to params.LATESTNrD   )r   rO   s     r   rS   z!TimeSeriesCommands._append_latestp  s.      	$MM(#####	$ 	$r    c                 <    ||                      d|g           dS dS )z+Append BUCKET_TIMESTAMP property to params.NBUCKETTIMESTAMPr   )r   rP   s     r   rX   z+TimeSeriesCommands._append_bucket_timestampv  s1     'MM,.>?@@@@@ ('r    c                 8    |r|                      d           dS dS )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 "#,9 tn	,9
 c3h(,9 SM,9 #3-,9 ,9 ,9 ,9b *.+/$(*.)8 )8)8 "#)8 c3h(	)8
 SM)8 #3-)8 )8 )8 )8` *.',+/$(*.26 2626 c?26 	26
 "#26 tn26 c3h(26 SM26 #3-26 26 26 26h7tE$c3h*G$HI 7 7 7 7& 04)-',+/$()9 )9)9 )9 E#s(O,	)9
 "#)9 tn)9 c3h()9 SM)9 )9 )9 )9^ 04)-',+/$()9 )9)9 )9 E#s(O,	)9
 "#)9 tn)9 c3h()9 SM)9 )9 )9 )9VF$ F3 F F F F F. *."= "="= "= 	"=
 "= "#"= "= "= "=HJT JT J J J J c? sCx	
 } #3- #3- tCy) &c] &c] c3h(  #3- ~   D  $*.*+,0-1-1+/!&*. %D8 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8 D8 D8 D8V  $*.*+,0-1-1+/!&*. %F; F;F; c?F; sCx	F;
 }F; #3-F; #3-F; tCy)F; &c]F; &c]F; c3h(F; F; #3-F; ~F; F; F; F;P""3-" #3-" }	"
 c" c?" sCx" d^" tCy)" &c]" &c]" #" "  S	*" c3h("  !"" #3-#"$ ~%" " " "R  $*.*+&+,0-1-1!% $-1+/!&*. %%V9 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9 V9 V9 V9z  $*.*+&+,0-1-1!% $-1+/!&*. %%V< 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< V< V< V<p
6 
6t 
6Xd^ 
6 
6 
6 
6 ',-1!&7 7c7 d^7  S	*	7
 7 7 7 7@3 3 3 3 3>$s) > > > > ,T#Y ,htn , , , \,
 ?S	?d^?  S	*? ? ? \?  JS	J$,SMJ;CC=J J J \J 4$s) 4 4 4 4 \4
 &tCy &(492E & & & \& ,d3i , , , , \,
 4$s) 4 4 4 4 \4
 ,d3i ,sCx0I , , , \,
 OS	O"3-O #3-O O O \O 649 6(3- 6 6 6 \6
 
FS	
F$,SM
FEMc]
F 
F 
F \
F 6DI 6c8K 6 6 6 \6
 ES	E&.smE@HE E E \E $tCy $(4. $ $ $ \$
 Ac Ahsm A A 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      s    5 5 5 5 5 5 5 5 5 5 5 5 5 5 & & & & & & % % % % % % % %
	 

 



 	g# g# g# g# g# g# g# g# g# g#r    