Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
May 22, 2024
Merged

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

merged 4 commits into from
May 22, 2024

Conversation

avbentem
Copy link
Contributor

@avbentem avbentem commented May 14, 2024

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:

DateTimeType = Union[
datetime,
Tuple[datetime, datetime],
Tuple[datetime, None],
Tuple[None, datetime],
]

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:

  • pre-commit hooks pass locally
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@vincentsarago
Copy link
Member

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

@vincentsarago vincentsarago self-requested a review May 21, 2024 19:25
@vincentsarago vincentsarago merged commit d2fd4a6 into stac-utils:main May 22, 2024
7 checks passed
@avbentem avbentem deleted the fix-688 branch June 4, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants