@@ -193,11 +193,11 @@ public static List<object> BuildTsCreateArgs(string key, long? retentionTime, IR
193193 return args ;
194194 }
195195
196- public static List < object > BuildTsAlterArgs ( string key , long ? retentionTime , IReadOnlyCollection < TimeSeriesLabel > labels )
196+ public static List < object > BuildTsAlterArgs ( string key , long ? retentionTime , IReadOnlyCollection < TimeSeriesLabel > ? labels )
197197 {
198198 var args = new List < object > { key } ;
199199 args . AddRetentionTime ( retentionTime ) ;
200- args . AddLabels ( labels ) ;
200+ if ( labels != null ) args . AddLabels ( labels ) ;
201201 return args ;
202202 }
203203
@@ -213,14 +213,14 @@ public static List<object> BuildTsAddArgs(string key, TimeStamp timestamp, doubl
213213 return args ;
214214 }
215215
216- public static List < object > BuildTsIncrDecrByArgs ( string key , double value , TimeStamp timestamp , long ? retentionTime ,
217- IReadOnlyCollection < TimeSeriesLabel > labels , bool ? uncompressed , long ? chunkSizeBytes )
216+ public static List < object > BuildTsIncrDecrByArgs ( string key , double value , TimeStamp ? timestamp , long ? retentionTime ,
217+ IReadOnlyCollection < TimeSeriesLabel > ? labels , bool ? uncompressed , long ? chunkSizeBytes )
218218 {
219219 var args = new List < object > { key , value } ;
220- args . AddTimeStamp ( timestamp ) ;
220+ if ( timestamp != null ) args . AddTimeStamp ( timestamp ) ;
221221 args . AddRetentionTime ( retentionTime ) ;
222222 args . AddChunkSize ( chunkSizeBytes ) ;
223- args . AddLabels ( labels ) ;
223+ if ( labels != null ) args . AddLabels ( labels ) ;
224224 args . AddUncompressed ( uncompressed ) ;
225225 return args ;
226226 }
@@ -252,33 +252,40 @@ public static List<object> BuildTsMgetArgs(IReadOnlyCollection<string> filter, b
252252 return args ;
253253 }
254254
255- public static List < object > BuildRangeArgs ( string key , TimeStamp fromTimeStamp , TimeStamp toTimeStamp , long ? count ,
256- TsAggregation ? aggregation , long ? timeBucket , IReadOnlyCollection < TimeStamp > filterByTs , ( long , long ) ? filterByValue ,
257- TimeStamp align )
255+ public static List < object > BuildRangeArgs ( string key ,
256+ TimeStamp fromTimeStamp ,
257+ TimeStamp toTimeStamp ,
258+ long ? count ,
259+ TsAggregation ? aggregation ,
260+ long ? timeBucket ,
261+ IReadOnlyCollection < TimeStamp > ? filterByTs ,
262+ ( long , long ) ? filterByValue ,
263+ TimeStamp ? align )
258264 {
259265 var args = new List < object > ( )
260266 { key , fromTimeStamp . Value , toTimeStamp . Value } ;
261- args . AddFilterByTs ( filterByTs ) ;
267+
268+ if ( filterByTs != null ) args . AddFilterByTs ( filterByTs ) ;
262269 args . AddFilterByValue ( filterByValue ) ;
263270 args . AddCount ( count ) ;
264- args . AddAlign ( align ) ;
271+ if ( align != null ) args . AddAlign ( align ) ;
265272 args . AddAggregation ( aggregation , timeBucket ) ;
266273 return args ;
267274 }
268275
269276
270277 public static List < object > BuildMultiRangeArgs ( TimeStamp fromTimeStamp , TimeStamp toTimeStamp ,
271278 IReadOnlyCollection < string > filter , long ? count , TsAggregation ? aggregation , long ? timeBucket ,
272- bool ? withLabels , ( string , TsReduce ) ? groupbyTuple , IReadOnlyCollection < TimeStamp > filterByTs ,
273- ( long , long ) ? filterByValue , IReadOnlyCollection < string > selectLabels , TimeStamp align )
279+ bool ? withLabels , ( string , TsReduce ) ? groupbyTuple , IReadOnlyCollection < TimeStamp > ? filterByTs ,
280+ ( long , long ) ? filterByValue , IReadOnlyCollection < string > ? selectLabels , TimeStamp ? align )
274281 {
275282 var args = new List < object > ( ) { fromTimeStamp . Value , toTimeStamp . Value } ;
276- args . AddFilterByTs ( filterByTs ) ;
283+ if ( filterByTs != null ) args . AddFilterByTs ( filterByTs ) ;
277284 args . AddFilterByValue ( filterByValue ) ;
278285 args . AddCount ( count ) ;
279- args . AddAlign ( align ) ;
286+ if ( align != null ) args . AddAlign ( align ) ;
280287 args . AddAggregation ( aggregation , timeBucket ) ;
281- args . AddWithLabels ( withLabels , selectLabels ) ;
288+ if ( selectLabels != null ) args . AddWithLabels ( withLabels , selectLabels ) ;
282289 args . AddFilters ( filter ) ;
283290 args . AddGroupby ( groupbyTuple ) ;
284291 return args ;
0 commit comments