-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: respect iox::column_type::field
metadata when mapping query results into values
#114
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #114 +/- ##
==========================================
+ Coverage 87.60% 88.03% +0.42%
==========================================
Files 15 15
Lines 1299 1337 +38
==========================================
+ Hits 1138 1177 +39
Misses 134 134
+ Partials 27 26 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for alerting me!
@jstirnaman thanks for you review! All is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, it looks good.
However, I would recommend changing interface{}
to any
Thx @vlastahajek, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
687fb20
to
dd4a81b
Compare
…esults into values
dd4a81b
to
795cb87
Compare
@karel-rehor, @vlastahajek, could you please review this PR again? I’ve updated the major version of the client and the base "package". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests pass locally. All examples work for me. Changes make sense. Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about providing a utility function for backward compatibility?
@vlastahajek, could you clarify what the function for backward compatibility will do? Will it be a helper to translate time.Time to arrow.Timestamp? |
// - iox::column_type::field::float: => float64 | ||
// - iox::column_type::field::string: => string | ||
// - iox::column_type::field::boolean: => bool | ||
// | ||
// Returns: | ||
// - A map[string]interface{} object representing the current value. | ||
func (i *QueryIterator) Value() map[string]interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change interface{}
-> any
here and elsewhere?
If it makes sense at all, either a function(s) that would convert the new output to the previous form for the output methods |
I don’t think that’s necessary. The changes involve the types of return objects. Previously, they were from the arrow package, but now they are GoLang types, which are more convenient for users and easier to use. |
Closes https://github.com/influxdata/EAR/issues/5646
Proposed Changes
1/ This PR changed how we parse response from InfluxDB, now we respect the
iox::column_type::field
metadata.2/ Enhance documentation for Query API.
Checklist