Repository navigation
Conversation
geo(lat, lon, radius) forwarded its arguments positionally to GeoValue(lon, lat, radius), so the geo filter it builds carried the coordinates swapped: geo(lat=51.45, lon=-0.44, radius=10) rendered [51.45 -0.44 10 km], where RediSearch expects [lon lat radius unit]. The helper's public lat, lon signature is unchanged; only the forwarding is corrected. Adds tests/test_search_querystring.py, which covers the pure-Python query-string builders without a server. Signed-off-by: simpleqt <2015900818@qq.com>
simpleqt
requested review from
ahmedsobeh,
bogdanp05,
mkmkme and
smeso
as code owners
October 21, 2026 15:56
Contributor
Author
|
Closing this to get my open pull requests in this repository down to a sane number: I had 8 open here at once, which is more than anyone should be asked to review. The branch stays in my fork if it is ever useful - happy to reopen on request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(search): render longitude before latitude in querystring
geo()geo()takes its coordinates inlat, lonorder and then passes thempositionally into
GeoValue, whose parameters arelon, lat:So the two coordinates are swapped on the way in, and a filter built for
London renders the wrong point:
[-0.44 51.45 ...]is what RediSearch expects — a geo filter is[lon lat radius unit]— and it is the order this repo already uses everywhere else:GeoValue.__init__(lon, lat, ...), itsto_string(), andquery.GeoFilter(field, lon, lat, radius, unit). Only this wrapper disagreed,which is why the bug is invisible from the
GeoValueside and only shows up forcallers of
geo().Change
The public signature stays
lat, lon, so no caller has to change; the value isjust handed to
GeoValuein the order that class actually takes. The docstringnow records why the swap exists, so it does not get "simplified" back.
Testing
tests/test_search_querystring.py(new — the query-string builders had no testfile) covers the rendering, that
geo()agrees with aGeoValuebuilt directly,that the requested unit survives, and that it behaves inside a compound query:
assert '[51.45 -0.44 10 km]' == '[-0.44 51.45 10 km]'ruffat the version.pre-commit-config.yaml/pyproject.tomlpins (0.17.0)passes
checkandformat --checkon both files.No open PR or issue covers this (checked the open PR list; my own open PR #369 is
the sentinel parsers and does not touch these files).
AI assistance: this change was produced with AI assistance (an autonomous coding
agent); the analysis, the reproduction, the before/after test runs and the lint
runs were executed locally, and a human reviewed the result before submission.