fix: remove hardcoded column names in db dump - #863
Open
jack89roberts wants to merge 1 commit into
Open
jack89roberts wants to merge 1 commit into
jack89roberts wants to merge 1 commit into
Conversation
`airsenal dump db` gave each CSV a hand-written list of fields, and `csv.DictWriter` raises on a row with a field it wasn't given. The lists had drifted from the models: `player_score` listed columns it doesn't have and left out `news` and `chance_of_playing`, so a single match with news on it failed the whole dump. Each file's fields now come from its model's columns. The tables and file names are unchanged, in one `DUMP_FILES` mapping. The functions take an optional session so the dump can be tested, and `save_table_fields` is now `save_table`, since it takes no fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #863 +/- ##
===========================================
+ Coverage 75.89% 76.17% +0.27%
===========================================
Files 130 130
Lines 7924 7912 -12
Branches 979 980 +1
===========================================
+ Hits 6014 6027 +13
+ Misses 1708 1683 -25
Partials 202 202 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
airsenal dump dbuses column names in database models rather than being hardcoded