Skip to content

smarkets: parse nanosecond timestamps on Python 3.10 - #34

Merged
YukiC0804 merged 1 commit into
mainfrom
sp/smarkets-py310
Oct 21, 2026
Merged

YukiC0804 merged 1 commit into
mainfrom
sp/smarkets-py310

Conversation

@YukiC0804

Copy link
Copy Markdown
Collaborator

Fixes the Python 3.10 CI failure on main after #33. Three tests failed: test_quotes_last_price_and_volume, test_results_from_a_settled_fixture and test_fetch_trades_oldest_first_from_the_recent_tape.

Smarkets timestamps carry up to nine fraction digits. iso_ms scanned every digit after the dot, the time zone's included, and Python 3.10's fromisoformat accepts only three or six fraction digits. The result was None on 3.10, while 3.12 and 3.13 passed. The fix takes the leading digits only and pads them to six.

Checked on Python 3.10: the full suite passes, as do the Betfair and Smarkets tests (182).

🤖 Generated with Claude Code

Smarkets sends up to nine fraction digits. The digit scan also picked up the
time zone's digits, and Python 3.10's fromisoformat takes only three or six
fraction digits, so every timestamp came back as None there. Take the
leading digits only and pad them to six.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YukiC0804
YukiC0804 merged commit 4cb5b6d into main Oct 21, 2026
4 checks passed
YukiC0804 added a commit that referenced this pull request Oct 21, 2026
Sync main into the experimental line (#34)
YukiC0804 pushed a commit that referenced this pull request Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YukiC0804 pushed a commit that referenced this pull request Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant