stac-utils / stac-fastapi

STAC API implementation with FastAPI.
https://stac-utils.github.io/stac-fastapi/
MIT License
242 stars 99 forks source link

Make `str_to_interval` not return a tuple for single-value input #692

Closed avbentem closed 4 months ago

avbentem commented 4 months ago

Related Issue(s):

Description:

This is a simple fix to return a single datetime object if a single value (rather than an interval) is given. This is already supported by DateTimeType:

https://github.com/stac-utils/stac-fastapi/blob/f815c236cde78a3442fe18c103f43ee1db668872/stac_fastapi/types/stac_fastapi/types/rfc3339.py#L15-L20

It then also changes the value of the datetime argument as passed to get_search, which so far is passed a tuple for a single-value datetime as well.

PR Checklist:

vincentsarago commented 4 months ago

I wrongly fixed this in #697, your PR is a better fix 🙏