Repository navigation
Preserve UTC query instants across API host timezones - #1155
Merged
mmguero merged 1 commit intoOct 7, 2026
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Contributor
Author
|
Focused timezone validation passes 25 tests across UTC, New York and Tokyo, including real query serialization and Flask GET/POST paths with network/database boundaries isolated. Could a maintainer review this when convenient? |
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1152.
Parse epoch strings as timezone-aware UTC values and give dateparser explicit UTC/timezone-aware settings for timezone-free input. Use the same parser for default bounds, so the query range does not depend on the API host's timezone.
Explicit input offsets, existing relative expressions, missing/invalid-input fallback behavior and inclusive millisecond bounds are preserved. This does not add new input formats or change request authorization, filters or aggregation behavior.
Testing
python -m pytest -q api/tests/test_query_timezones.py25 focused tests passed; 12 fail on unchanged source. Tests exercise UTC, America/New_York and Asia/Tokyo, equivalent epoch/naive/UTC/offset inputs, defaults, relative expressions, real OpenSearch Search serialization and actual Flask GET/POST aggregation requests.
The API imports normally with credential lookup and network transport isolated. Database search and field-mapping responses are fixed local fixtures. Host timezone changes are restored after each test. No listening server, live database, production credentials or full deployment was used.
Tested on macOS with Python 3.12. New-test formatting, scoped syntax/lint checks and
git diff --checkpass. No dependency, workflow or version changes.Thanks for taking a look.