Skip to content

fix: remove hardcoded column names in db dump - #863

Open
jack89roberts wants to merge 1 commit into
developfrom
bugfix/db-dump-columns
Open

jack89roberts wants to merge 1 commit into
developfrom
bugfix/db-dump-columns

Conversation

@jack89roberts

Copy link
Copy Markdown
Contributor

airsenal dump db uses column names in database models rather than being hardcoded

`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-commenter

codecov-commenter commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.17%. Comparing base (7a2acfd) to head (89f4173).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack89roberts jack89roberts changed the title fix: a database dump writes the columns each table has fix: remove hardcoded column names in dB dump Sep 27, 2026
@jack89roberts jack89roberts changed the title fix: remove hardcoded column names in dB dump fix: remove hardcoded column names in db dump Sep 27, 2026
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.

2 participants