-
Notifications
You must be signed in to change notification settings - Fork 53
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
Python: adds GEODIST command #1260
Conversation
8a97cbf
to
3888f2d
Compare
@@ -221,7 +221,7 @@ pub(crate) fn expected_type_for_cmd(cmd: &Cmd) -> Option<ExpectedReturnType> { | |||
b"HEXISTS" | b"HSETNX" | b"EXPIRE" | b"EXPIREAT" | b"PEXPIRE" | b"PEXPIREAT" | |||
| b"SISMEMBER" | b"PERSIST" => Some(ExpectedReturnType::Boolean), | |||
b"SMEMBERS" => Some(ExpectedReturnType::Set), | |||
b"ZSCORE" => Some(ExpectedReturnType::DoubleOrNull), | |||
b"ZSCORE" | b"GEODIST" => Some(ExpectedReturnType::DoubleOrNull), |
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.
Do you want to add a test?
|
||
Returns: | ||
Optional[float]: The distance between `member` and `member2`. | ||
If one or both members do not exist, or if the key does not exist, returns None. |
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.
If one or both members do not exist, or if the key does not exist, returns None. | |
If one or both members do not exist, or if the key does not exist, returns `None`. |
>>> await client.geoadd("my_geo_set", {"Palermo": Coordinate(13.361389, 38.115556), "Catania": Coordinate(15.087269, 37.502669)}) | ||
2 # Indicates that two elements have been added to the sorted set "my_geo_set". |
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.
I think you can omit geoadd
here
|
||
Returns: | ||
Optional[float]: The distance between `member` and `member2`. | ||
If one or both members do not exist, or if the key does not exist, returns None. |
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.
If one or both members do not exist, or if the key does not exist, returns None. | |
If one or both members do not exist, or if the key does not exist, returns `None`. |
Adds geospatial members with their positions to the specified sorted set stored at `key`. | ||
If a member is already a part of the sorted set, its position is updated. | ||
|
||
See https://redis.io/commands/geoadd for more details. |
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.
See https://redis.io/commands/geoadd for more details. | |
See https://valkey-io.github.io/commands/geoadd for more details. |
""" | ||
Returns the distance between two members in the geospatial index stored at `key`. | ||
|
||
See https://redis.io/commands/geodist for more details. |
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.
See https://redis.io/commands/geodist for more details. | |
See https://valkey-io.github.io/commands/geodist for more details. |
""" | ||
Returns the distance between two members in the geospatial index stored at `key`. | ||
|
||
See https://redis.io/commands/geodist for more details. |
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.
See https://redis.io/commands/geodist for more details. | |
See https://valkey-io.github.io/commands/geodist for more details. |
0bb6532
to
036f175
Compare
036f175
to
38c4d37
Compare
== None | ||
) | ||
|
||
assert await redis_client.set(key2, "value") == OK |
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.
add a comment for that test
b784b3a
to
d4a2f7e
Compare
d4a2f7e
to
cfb377e
Compare
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.
please fix the typo error (at least)
Co-authored-by: Yury-Fridlyand <[email protected]>
0c47860
to
9c6d59c
Compare
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.