Conversation
…PI responses Remove the _transform_keys_in_data function from MlbDataAdapter that was lowercasing all API response keys. Models now directly use the camelCase field names returned by the MLB Stats API. Key changes: - Remove _transform_keys_in_data() function and its usage - Update model field aliases to match actual API camelCase format: * homeRun, tieBreaker, isHomeRun, isTieBreaker (homerunderby) * dateTime, timeStamp, metaData (game models) * inTieBreaker, tieBreakerNum (homerunderby status) * wobaCon (stats) - Make optional fields that may be missing in API responses: * calendar_event_id, start_time_tbd (game models) * wildcard_games_back, wildcard_elimination_number (standings) - Update external tests to use camelCase field names - Remove all mock tests and associated JSON fixtures (22,370 lines) This simplifies the codebase by removing an unnecessary transformation layer and ensures models directly reflect the API's native response format.
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.
What
Tests
External tests updated and passing with camelCase field names. Mock tests removed.
Risk and impact
Risk level: Normal
Well-scoped refactoring that removes transformation layer. Pydantic models maintain same Pythonic `snake_case` attribute names via aliases. External tests validate changes work with real API responses.
Impact if something goes wrong: