Skip to content

Commit 69014d6

Browse files
committed
fix handling of empty string open-ended interval
1 parent 083242f commit 69014d6

File tree

2 files changed

+5
-4
lines changed
  • stac_fastapi
    • pgstac/stac_fastapi/pgstac
    • sqlalchemy/stac_fastapi/sqlalchemy

2 files changed

+5
-4
lines changed

stac_fastapi/pgstac/stac_fastapi/pgstac/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async def item_collection(
184184
Called with `GET /collections/{collection_id}/items`
185185
186186
Args:
187-
id: id of the collection.
187+
collection_id: id of the collection.
188188
limit: number of items to return.
189189
token: pagination token.
190190

stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/core.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,14 @@ def post_search(
349349
# Non-interval date ex. "2000-02-02T00:00:00.00Z"
350350
if len(dts) == 1:
351351
query = query.filter(self.item_table.datetime == dts[0])
352-
elif ".." not in search_request.datetime:
352+
# is there a benefit to between instead of >= and <= ?
353+
elif dts[0] not in ["", ".."] and dts[1] not in ["", ".."]:
353354
query = query.filter(self.item_table.datetime.between(*dts))
354355
# All items after the start date
355-
elif dts[0] != "..":
356+
elif dts[0] not in ["", ".."]:
356357
query = query.filter(self.item_table.datetime >= dts[0])
357358
# All items before the end date
358-
elif dts[1] != "..":
359+
elif dts[1] not in ["", ".."]:
359360
query = query.filter(self.item_table.datetime <= dts[1])
360361

361362
# Query fields

0 commit comments

Comments
 (0)