fix(pricehistory): parse start/end datetime from epoch-ms or ISO 8601 + track uv.lock#8
Merged
rdemeritt merged 2 commits intoJun 17, 2026
Conversation
Adds _parse_datetime_param() to accept epoch-ms integer strings (primary exo path) and ISO 8601 strings (with/without tz offset) and wires it into the start_datetime/end_datetime kwargs on /v1/pricehistory, satisfying schwab-py 1.5.1 which requires datetime objects, not raw strings. Adds tests/test_pricehistory_datetime.py (9 cases, all passing).
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 a critical bug in
/v1/pricehistoryendpoint where exo sendsstart_datetimeandend_datetimeas epoch-millisecond integers or ISO 8601 strings, but schwab-py 1.5.1 requires proper datetime objects. Without this fix, the endpoint silently fails to apply the datetime filters.Adds
_parse_datetime_param()utility to normalize both epoch-ms and ISO 8601 formats (with/without tz offset) into tz-aware UTC datetime objects. Wires this into the kwargs passed to schwab-py's pricehistory client method.Also tracks
uv.lockfor reproducible localuv buildenvironments (CI/Docker continue to use pip+requirements.txt).QA Status
Approved 39/39 test criteria. Adds 9 new test cases covering:
Files Changed
app/schwab_data_proxy/rest_proxy.py: +31 lines (datetime parsing logic)tests/test_pricehistory_datetime.py: new test file, 120 lines, 9 casesuv.lock: tracked for reproducibility