File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def test_items_limit_and_offset(app):
6464 assert body ["numberReturned" ] == 1
6565 assert ["collection" , "self" , "prev" ] == [link ["rel" ] for link in body ["links" ]]
6666
67+ # offset overflow, return empty feature collection
6768 response = app .get ("/collections/public.landsat_wrs/items?offset=20000" )
6869 assert response .status_code == 200
6970 body = response .json ()
Original file line number Diff line number Diff line change @@ -431,13 +431,10 @@ async def query(
431431 async with pool .acquire () as conn :
432432 items = await conn .fetchval (q , * p )
433433
434- if items and items ["features" ]:
435- return (
436- FeatureCollection (features = items ["features" ]),
437- items ["total_count" ],
438- )
439- else :
440- return FeatureCollection (features = []), items ["total_count" ]
434+ return (
435+ FeatureCollection (features = items .get ("features" ) or []),
436+ items ["total_count" ],
437+ )
441438
442439 async def features (
443440 self ,
You can’t perform that action at this time.
0 commit comments