feat(models): add parent_event_id to Event#96
Merged
Conversation
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
Adds
parent_event_idto theEventmodel so sports "more markets" events can be linked to their parent game event.EventId | None(notint): upstream returnsparentEventIdas an integer while event ids are strings, so the value is coerced through the existingcoerce_string_idvalidator to stay comparable withEvent.id.None; the field is absent on many events andnullon parents.Verification
make check(ruff, format, pyright, pytest) passes. One unrelated network-flaky test (test_secure_client_defaults_wallet_to_current_deposit_wallet) timed out once and passed on rerun.get_event(id='570555')returnsparent_event_id == '570146', andget_event(id=child.parent_event_id)round-trips to the parent event, which itself hasparent_event_id is None.Note
Low Risk
Additive optional field on the Event parser with existing coercion patterns; no client or API behavior changes in this diff.
Overview
Adds optional
parent_event_idon the gammaEventmodel so child events (e.g. sports “more markets”) can point at their parent game event.The API’s
parentEventIdis wired through theparentEventIdalias and the flat-payload_normalize_eventpath, and integers are coerced to stringEventIdvia the same_coerce_idvalidator used forid. The field defaults toNonewhen missing or null.Unit tests cover integer coercion and absent/null defaults.
Reviewed by Cursor Bugbot for commit c966aec. Bugbot is set up for automated code reviews on this repo. Configure here.