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

Python: adds GEOADD command #1259

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Conversation

shohamazon
Copy link
Collaborator

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.

@shohamazon shohamazon added the python Python wrapper label Apr 10, 2024
@shohamazon shohamazon requested a review from a team as a code owner April 10, 2024 09:51
@shohamazon shohamazon force-pushed the python/geoadd branch 3 times, most recently from c527860 to 94f0281 Compare April 10, 2024 11:55
@@ -143,6 +143,7 @@ enum RequestType {
Blpop = 100;
RPushX = 102;
LPushX = 103;
GeoAdd = 104;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: you may have number conflict

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it's fine


The exact limits, as specified by EPSG:900913 / EPSG:3785 / OSGEO:41001 are the following:
- Valid longitudes are from -180 to 180 degrees.
- Valid latitudes are from -85.05112878 to 85.05112878 degrees.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The north pole is out of range - wow

python/python/glide/async_commands/core.py Show resolved Hide resolved
python/python/glide/async_commands/core.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/transaction.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/core.py Show resolved Hide resolved
}
assert await redis_client.geoadd(key, members_coordinates) == 2
members_coordinates["Catania"].latitude = 39
assert (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can skip () after assert

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its the linter :)

python/python/tests/test_async_client.py Show resolved Hide resolved
@shohamazon shohamazon force-pushed the python/geoadd branch 2 times, most recently from c7f989f to c9ab616 Compare April 15, 2024 12:04
)
== 2
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can query the key with ZRANGE to show/check its content
See example for geosearchstore at the very bottom

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not exactly true, its after storing the dist in a different key using geosearchstore

@@ -33,7 +33,7 @@

class ConditionalChange(Enum):
"""
A condition to the "SET" and "ZADD" commands.
A condition to the `SET`, `ZADD` and `GEOADD` commands.
- ONLY_IF_EXISTS - Only update key / elements that already exist. Equivalent to `XX` in the Redis API
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Redis', redis.io and other possible trademarks.
I dont think we should continue to introduce these into our code.
Instead, I propose to use RESP3 i.e. 'Equivalent to XX in the RESP protocol.
Please consult with @asafpamzn ( you can setup a call for all of us)

@shohamazon shohamazon merged commit 53bed48 into valkey-io:main Apr 18, 2024
45 checks passed
@shohamazon shohamazon deleted the python/geoadd branch April 18, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants