Skip to content

Commit 64a238d

Browse files
committed
change type to str
1 parent 55a36d3 commit 64a238d

File tree

1 file changed

+7
-7
lines changed
  • stac_fastapi/core/stac_fastapi/core

1 file changed

+7
-7
lines changed

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ async def item_collection(
277277
self,
278278
collection_id: str,
279279
bbox: Optional[BBox] = None,
280-
datetime: Optional[DateTimeType] = None,
280+
datetime: Optional[str] = None,
281281
limit: Optional[int] = 10,
282282
token: Optional[str] = None,
283283
**kwargs,
@@ -287,7 +287,7 @@ async def item_collection(
287287
Args:
288288
collection_id (str): The identifier of the collection to read items from.
289289
bbox (Optional[BBox]): The bounding box to filter items by.
290-
datetime (Optional[DateTimeType]): The datetime range to filter items by.
290+
datetime (Optional[str]): The datetime range to filter items by.
291291
limit (int): The maximum number of items to return. The default value is 10.
292292
token (str): A token used for pagination.
293293
request (Request): The incoming request.
@@ -426,7 +426,7 @@ def _return_date(
426426

427427
return result
428428

429-
def _format_datetime_range(self, date_tuple: str) -> str:
429+
def _format_datetime_range(self, date_str: str) -> str:
430430
"""
431431
Convert a datetime range into a formatted string.
432432
@@ -436,7 +436,7 @@ def _format_datetime_range(self, date_tuple: str) -> str:
436436
Returns:
437437
str: A string formatted as 'YYYY-MM-DDTHH:MM:SS.sssZ/YYYY-MM-DDTHH:MM:SS.sssZ', with '..' used if any element is None.
438438
"""
439-
start, end = date_tuple.split("/")
439+
start, end = date_str.split("/")
440440
start = start.replace("+01:00", "Z") if start else ".."
441441
end = end.replace("+01:00", "Z") if end else ".."
442442
return f"{start}/{end}"
@@ -447,7 +447,7 @@ async def get_search(
447447
collections: Optional[List[str]] = None,
448448
ids: Optional[List[str]] = None,
449449
bbox: Optional[BBox] = None,
450-
datetime: Optional[DateTimeType] = None,
450+
datetime: Optional[str] = None,
451451
limit: Optional[int] = 10,
452452
query: Optional[str] = None,
453453
token: Optional[str] = None,
@@ -465,7 +465,7 @@ async def get_search(
465465
collections (Optional[List[str]]): List of collection IDs to search in.
466466
ids (Optional[List[str]]): List of item IDs to search for.
467467
bbox (Optional[BBox]): Bounding box to search in.
468-
datetime (Optional[DateTimeType]): Filter items based on the datetime field.
468+
datetime (Optional[str]): Filter items based on the datetime field.
469469
limit (Optional[int]): Maximum number of results to return.
470470
query (Optional[str]): Query string to filter the results.
471471
token (Optional[str]): Access token to use when searching the catalog.
@@ -492,7 +492,7 @@ async def get_search(
492492
}
493493

494494
if datetime:
495-
base_args["datetime"] = self._format_datetime_range(datetime)
495+
base_args["datetime"] = self._format_datetime_range(date_str=datetime)
496496

497497
if intersects:
498498
base_args["intersects"] = orjson.loads(unquote_plus(intersects))

0 commit comments

Comments
 (0)