Skip to content

The default SafePropertyNames in GetInfluxSeries will cause problems when case sensitives #100

@goxiaoy

Description

@goxiaoy

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

for (var col = 0; col < series.Columns.Count; col++)
{
string header;
if (SafePropertyNames)
header = char.ToUpper(series.Columns[col][0]) + series.Columns[col].Substring(1);
else
header = series.Columns[col];
if (String.Equals(header, "Time", StringComparison.OrdinalIgnoreCase))
((IDictionary<string, object>)entry).Add(header, EpochHelper.FromEpoch(series.Values[row][col], precision));
else
((IDictionary<string, object>)entry).Add(header, series.Values[row][col]);
}

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions