Skip to content

Conversation

@YuriZmytrakov
Copy link
Collaborator

@YuriZmytrakov YuriZmytrakov commented Sep 1, 2025

Description:
Fixes an issue in the OS STAC /search endpoint where datetime filters overwrite milliseconds. The queries return products outside the specified range because the filter was rounding datetimes to full seconds. This change ensures that milliseconds are preserved, so datetime filtering returns correct results.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

@YuriZmytrakov YuriZmytrakov marked this pull request as draft September 1, 2025 13:22
@YuriZmytrakov YuriZmytrakov force-pushed the CAT-1413 branch 8 times, most recently from bfb3c1a to cd5290e Compare September 1, 2025 16:33
@YuriZmytrakov YuriZmytrakov changed the title fix format_datetime_range Ensure Normalize func preserves milliseconds precision Sep 1, 2025
@YuriZmytrakov YuriZmytrakov force-pushed the CAT-1413 branch 2 times, most recently from c62a9d0 to 68af7ab Compare September 9, 2025 12:20
Normalize function for datetime strings did not preserve milliseconds, causing the `/search`
endpoint return incorrect results. This change ensures that milliseconds are retained when normalized.
Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@jonhealy1 jonhealy1 merged commit 77d77d4 into stac-utils:main Sep 13, 2025
15 checks passed
YuriZmytrakov added a commit to YuriZmytrakov/stac-fastapi-elasticsearch-opensearch that referenced this pull request Sep 15, 2025
**Description:**
Fixes an issue in the OS STAC `/search` endpoint where datetime filters
overwrite milliseconds. The queries return products outside the
specified range because the filter was rounding datetimes to full
seconds. This change ensures that milliseconds are preserved, so
datetime filtering returns correct results.

**PR Checklist:**

- [x] Code is formatted and linted (run `pre-commit run --all-files`)
- [x] Tests pass (run `make test`)
- [ ] Documentation has been updated to reflect changes, if applicable
- [x] Changes are added to the changelog

---------

Co-authored-by: Yuri Zmytrakov <[email protected]>
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.

2 participants