Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
goxiaoy opened this issue Sep 23, 2020 · 0 comments

Comments

@goxiaoy
Copy link

goxiaoy commented Sep 23, 2020

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant