InfluxDB.Client.Net icon indicating copy to clipboard operation
InfluxDB.Client.Net copied to clipboard

The default SafePropertyNames in GetInfluxSeries will cause problems when case sensitives

Open goxiaoy opened this issue 3 years ago • 0 comments

Considering the folling cases when InfluxDb return

Sequence sequence
2 3

This is valid and I put one in Tag and put one in Field

when execute in https://github.com/AdysTech/InfluxDB.Client.Net/blob/779b171e1380435eac5afa656a36555598ceeb22/src/DataStructures/InfluxDBClient.cs#L899-L910

An error will throw

[14:37:06 ERR] An element with the same key 'Sequence' already exists in the ExpandoObject. (Parameter 'key')
System.ArgumentException: An element with the same key 'Sequence' already exists in the ExpandoObject. (Parameter 'key')
   at System.Dynamic.ExpandoObject.TrySetValue(Object indexClass, Int32 index, Object value, String name, Boolean ignoreCase, Boolean add)
   at System.Dynamic.ExpandoObject.TryAddMember(String key, Object value)
   at System.Dynamic.ExpandoObject.System.Collections.Generic.IDictionary<System.String,System.Object>.Add(String key, Object value)
   at AdysTech.InfluxDB.Client.Net.InfluxDBClient.GetInfluxSeries(TimePrecision precision, Series series, Nullable`1 partialResult, Boolean SafePropertyNames)
   at AdysTech.InfluxDB.Client.Net.InfluxDBClient.QueryMultiSeriesAsync(String dbName, String measurementQuery, String retentionPolicy, TimePrecision precision)

goxiaoy avatar Sep 23 '20 07:09 goxiaoy