-
Notifications
You must be signed in to change notification settings - Fork 38
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
Implement support for ValueType VALUE_POINT. #45
base: master
Are you sure you want to change the base?
Conversation
Currently, returning a point fails to parse. RedisGraph implements this value type as a 2-element array (see _ResultSet_CompactReplyWithPoint). In this client implementation, I parse that into a 2-element map[string]float64.
Please take a look @filipecosta90 |
func (qr *QueryResult) parsePoint(cell interface{}) map[string]float64 { | ||
point := make(map[string]float64) | ||
var array = cell.([]interface{}) | ||
if len(array) == 2 { |
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.
This condition should always be true, but there is no harm in checking for it.
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.
This looks great, thank you for the contribution!
@@ -45,6 +45,7 @@ const ( | |||
VALUE_NODE | |||
VALUE_PATH | |||
VALUE_MAP | |||
VALUE_POINT |
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.
don't use ALL_CAPS in Go names; use CamelCase
@mitchsw Sorry for the delay, we had a hiccup with our CI testing! Would you mind making a new commit through a command like That should re-trigger our CI and allow us to merge this feature. Thanks! |
Currently, returning a point fails to parse. RedisGraph returns a point as a 2-element double array (see _ResultSet_CompactReplyWithPoint). In this client implementation, I parse those float strings into a 2-element map[string]float64.