Commit 6f74a12
fix: ensure isformat does not truncate 0Z (#535)
**Description:**
This PR fixes `.0Z` milliseconds being truncated by `isformat`, causing
items outside the expected datetime range to be returned. The
apply_filter_datetime function was updated to preserve milliseconds when
filtering, ensuring that only items exactly within the specified
datetime range are included.
Example `2023-01-09T13:39:39.0Z` returned item
`2023-01-09T13:39:39.024Z` which is not within the specified range, but
was returned because .0Z was truncated to 2023-01-09T13:39:39Z.
After the fix, queries respect millisecond precision, and only items
strictly within the specified range are returned.
**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 <yzmytrakovNB@yzmytrakovNB.local>1 parent ddee878 commit 6f74a12
File tree
2 files changed
+6
-1
lines changed- stac_fastapi/core/stac_fastapi/core
2 files changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
0 commit comments