Skip to content

chore: add live stat field population audit - #338

Closed
Mattsface wants to merge 1 commit into
mainfrom
audit/stat-field-population
Closed

chore: add live stat field population audit#338
Mattsface wants to merge 1 commit into
mainfrom
audit/stat-field-population

Conversation

@Mattsface

Copy link
Copy Markdown
Member

Summary

Adds a developer-only live audit script for comparing MLB Stats API payload fields with values populated by python-mlb-statsapi models.

The audit classifies fields as:

  • PASS — raw MLB value matches the parsed model value
  • MLB OMITTED — model supports the field but MLB did not send it
  • MODEL MISSING — MLB sent a key not represented by the parsed model
  • PARSE FAILURE — MLB sent a non-null value but the model populated None
  • MISMATCH — MLB and parsed values differ

Defaults to Aaron Judge, Shohei Ohtani, and Juan Soto for 2025 hitting season and seasonAdvanced stats. Players, season, group, and stat types can be overridden from the CLI.

This is intentionally not part of CI because it depends on the live MLB API.

Usage

poetry run python scripts/audit_stat_fields.py

Verbose output including passing fields:

poetry run python scripts/audit_stat_fields.py --verbose

Custom example:

poetry run python scripts/audit_stat_fields.py --season 2024 --stat season --player 592450:Judge

Context

This follows the investigation in #246, where airOuts was confirmed to be returned and populated correctly while flyOuts was omitted from the standard season payload.

@Mattsface Mattsface closed this Aug 30, 2026
@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

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.

1 participant