Skip to content

Commit

Permalink
Enabled property search while searching features in bbox
Browse files Browse the repository at this point in the history
Signed-off-by: Kharude, Sachin <sachin.kharude@here.com>
  • Loading branch information
Kharude, Sachin authored and omanges committed Aug 21, 2020
1 parent 72a5551 commit 2ecc000
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 5 additions & 9 deletions tests/hub/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,11 @@ def test_get_space_bbox(api, space_id):
assert len(bbox["features"]) == 0
assert bbox["type"] == "FeatureCollection"

with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered.
warnings.simplefilter("always")
# Trigger a warning.
api.get_space_bbox(space_id=space_id, bbox=bb, params={"foo": "bar"})
# Verify some things
assert len(w) == 1
assert issubclass(w[-1].category, UserWarning)
assert str(w[-1].message).endswith("not supported, yet.")
resp = api.get_space_bbox(
space_id=space_id, bbox=bb, params={"p.name": "Ghana"}
)
assert len(resp["features"]) == 1
assert resp["type"] == "FeatureCollection"

bbox = api.get_space_bbox(space_id=space_id, bbox=bb, selection=["p.name"])
assert bbox["features"][0]["properties"]["name"] == "Benin"
Expand Down
6 changes: 1 addition & 5 deletions xyzspaces/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,7 @@ def get_space_bbox(
if clustering:
q_params["clustering"] = clustering
if params:
warnings.warn(
f"The 'params' parameter for the `{path}` API endpoint "
"is not supported, yet."
)
# TODO
q_params.update(params)
if selection:
q_params["selection"] = ",".join(selection)
if clusteringParams:
Expand Down

0 comments on commit 2ecc000

Please sign in to comment.