-
Notifications
You must be signed in to change notification settings - Fork 95
No timestamp returned via POCO based QueryAsync<T> #119
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
Comments
As a side note, have you considered creating an overload that will directly return an Could even provide a new method like |
I added a pull request for this feature #121 FYI, this PR includes both the timestamp fix plus the enhancement - let me know if I should separate these. |
Hi @ritchiecarroll, thanks for using our client library and creating PRs. We will include them in the next release. I tried couple of tests and deserialisation of timestamp works only with Column.Name annotation set on "time".
I found also problem with DateTime.Now, Poco with such timestamp is not written to InfluxDB, We definitely need to add more unit tests related to Poco and timestamps. |
I am experiencing a similar issue where querying DateTime via a POCO always returns
Our object looks like the following:
Looking through the queried |
Hi @shialex, Could you share how you Flux query looks like? The query should use pivot() function, something like: var query = $"from(bucket:\"{bucket}\") " +
"|> range(start: 0) " +
"|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")"; Check out this example: PocoQueryWriteExample.cs. Regards |
Hello @bednar, You are completely correct, I forgot about the pivot() function in the Flux query. I'm using the query you posted and everything queried seems correct now but |
Hi ,I encounter the same error with the lateast version InfluxDB.Client 2.1.0.
the temperature.Time is still the wrong time:0001/1/1 0:00:00 |
Hi @wen2204, Can you share debug output from client? You can enable debug mode by: var client = InfluxDBClientFactory.Create("http://localhost:9999",
"my-token".ToCharArray());
client.SetLogLevel(LogLevel.Body); Regards |
With a simple class like the following:
Data writes fine and I can verify through a CLI query that timestamps are accurately stored, but when retriving data, the timestamp is always zero, i.e.,
DateTime.MinValue
.Here's the query code:
Seems like the marked
IsTimestamp
column is being missed during deserialization.Also, tried several variations on POCO timestamp column:
The text was updated successfully, but these errors were encountered: