Repository navigation
feat(schema): provider_name in Odds and OddsLine - #249
Merged
Merged
Conversation
The bookmaker's name is derived from the built-in table sports.ODDS_PROVIDERS when the record is mapped (null for an unknown id); nothing stored changes and no request is made. An added field is free in schema v1, so schema_version stays 1. Regenerated: the JSON Schema golden, the generated tables and examples of 04-schema-v1.md, docs/api/openapi-v1.json and frontend/src/api/v1/schema.ts.
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.
Open item of
03-implementation-plan.mdsection 20: aprovider_namefield in schema v1.What
OddsandOddsLine(sofascore_scraper/schema/models.py) getprovider_name: Optional[str]right afterprovider_id.mappers.odds_from_payloadfills it from the built-in tablesports.ODDS_PROVIDERS(B4, feat: show odds providers by name (B4) #192) viasports.odds_provider(); null when the id is unknown or absent.odds_linescopies it to every row.Schema version
Adding a field is free under
04-schema-v1.mdsection 3, soschema_versionstays 1. A dated amendment note at the top of04says so.Regenerated
tests/golden/schema/json_schema.json(REGEN_SCHEMA_GOLDEN=1)Odds/OddsLinein04-schema-v1.md(REGEN_SCHEMA_DOC=1), plus the two examples by handdocs/api/openapi-v1.json(theOddsrecord of/events/{id}/odds/{key})frontend/src/api/v1/schema.ts(npm run gen:api);vue-tsc -bclean, vitest 388 passedExport
The
oddsdataset gains the columnprovider_nameafterprovider_id(tabular columns follow the model's field order vialeaf_paths). No export golden pins odds columns; the header assertion intests/test_odds_slices.pywas updated.Docs
CHANGELOG (Unreleased → Added);
04-schema-v1.md(tables, examples, the provider prose, amendment note);03section 20 bullet marked done and the M20 row;02-services.mdand05-web-ui.mdno longer call the field open.Tests
bet365, 1528, 1781 named, unknown 5 → null, no provider → null, lines and export rows carry the name.