diff options
author | laixintao <laixintaoo@gmail.com> | 2022-06-24 00:31:25 +0800 |
---|---|---|
committer | laixintao <laixintaoo@gmail.com> | 2022-06-24 00:31:25 +0800 |
commit | ad88773584f4a5042e22cf4c36f40bcf286f9e18 (patch) | |
tree | eabec023b9da076f66dda1bba3145ae6b4eaf1bf | |
parent | ff088a13147b9d99b1c1ba6592488c904022be59 (diff) |
geo command depreacted.
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | iredis/data/command_syntax.csv | 4 | ||||
-rw-r--r-- | iredis/redis_grammar.py | 14 | ||||
-rw-r--r-- | tests/unittests/command_parse/test_geo.py | 28 |
4 files changed, 4 insertions, 44 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9238de6..12c217c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - Feature: support new command: `FAILOVER`. - Feature: `FLUSHDB` and `FLUSHALL` supports `SYNC` option. - Feature: `GEOADD` supports `CH XX NX` options. +- Deprecate: `GEORADIUS` is deprecated, no auto-complete for this command anymore. +- Deprecate: `GEORADIUSBYMEMBER` is deprecated, no auto-complete for this command anymore. ## 1.11.1 diff --git a/iredis/data/command_syntax.csv b/iredis/data/command_syntax.csv index 9f0ac71..560867a 100644 --- a/iredis/data/command_syntax.csv +++ b/iredis/data/command_syntax.csv @@ -73,8 +73,8 @@ geo,GEOADD,command_key_longitude_latitude_members,render_int geo,GEODIST,command_geodist,render_bulk_string geo,GEOHASH,command_key_members,render_list geo,GEOPOS,command_key_members,render_list -geo,GEORADIUS,command_radius,render_list_or_string -geo,GEORADIUSBYMEMBER,command_georadiusbymember,render_list_or_string +geo,GEORADIUS,command_any,render_list_or_string +geo,GEORADIUSBYMEMBER,command_any,render_list_or_string hash,HDEL,command_key_fields,render_int hash,HEXISTS,command_key_field,render_int hash,HGET,command_key_field,render_bulk_string diff --git a/iredis/redis_grammar.py b/iredis/redis_grammar.py index 3b9f2d8..d3bd17e 100644 --- a/iredis/redis_grammar.py +++ b/iredis/redis_grammar.py @@ -369,14 +369,6 @@ command_grammar = compile(COMMAND) GRAMMAR = { "command_key": rf"\s+ {KEY} \s*", "command_pattern": rf"\s+ {PATTERN} \s*", - "command_georadiusbymember": rf""" - \s+ {KEY} \s+ {MEMBER} - \s+ {FLOAT} \s+ {DISTUNIT} - (\s+ {GEOCHOICE})* - (\s+ {COUNT_CONST} \s+ {COUNT})? - (\s+ {ORDER})? - (\s+ {CONST_STORE} \s+ {KEY})? - (\s+ {CONST_STOREDIST} \s+ {KEY})? \s*""", "command_command": rf"\s+ {COMMAND} \s*", "command_slots": rf"\s+ {SLOTS} \s*", "command_node": rf"\s+ {NODE} \s*", @@ -513,12 +505,6 @@ GRAMMAR = { )? (\s+ {CONST_KEYS} \s+ {KEYS})? \s*""", - "command_radius": rf"""\s+ {KEY} - \s+ {LONGITUDE} \s+ {LATITUDE} \s+ {FLOAT} \s+ {DISTUNIT} - (\s+ {GEOCHOICE})* (\s+ {COUNT_CONST} \s+ {COUNT})? - (\s+ {ORDER})? - (\s+ {CONST_STORE} \s+ {KEY})? - (\s+ {CONST_STOREDIST} \s+ {KEY})? \s*""", "command_restore": rf"""\s+ {KEY} \s+ {TIMEOUT} \s+ {VALUE} (\s+ {SUBRESTORE} \s+ {SECOND})? \s*""", "command_pubsubcmd_channels": rf"\s+ {PUBSUBCMD} (\s+ {CHANNEL})+ \s*", diff --git a/tests/unittests/command_parse/test_geo.py b/tests/unittests/command_parse/test_geo.py index a162aa6..ba9c3fd 100644 --- a/tests/unittests/command_parse/test_geo.py +++ b/tests/unittests/command_parse/test_geo.py @@ -21,31 +21,3 @@ def test_geoadd(judge_command): "member": '"Catania"', }, ) - - -def test_georadiusbymember(judge_command): - judge_command( - "GEORADIUSBYMEMBER Sicily Agrigento 100 km", - { - "command": "GEORADIUSBYMEMBER", - "key": "Sicily", - "member": "Agrigento", - "float": "100", - "distunit": "km", - }, - ) - - -def test_georadius(judge_command): - judge_command( - "GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD ", - { - "command": "GEORADIUS", - "key": "Sicily", - "longitude": "15", - "latitude": "37", - "float": "200", - "distunit": "km", - "geochoice": "WITHCOORD", - }, - ) |