Skip to content

fix: allow gamePks schedule queries without date - #308

Merged
Mattsface merged 4 commits into
mainfrom
fix/245-schedule-gamepk-without-date
Aug 10, 2026
Merged

fix: allow gamePks schedule queries without date#308
Mattsface merged 4 commits into
mainfrom
fix/245-schedule-gamepk-without-date

Conversation

@Mattsface

Copy link
Copy Markdown
Member

Why

Fixes #245.

Schedule requests using gamePks were incorrectly requiring a date. Both get_schedule() and get_scheduled_games_by_date() would return None before the request ever reached the MLB API when gamePks was provided without a date.

The MLB schedule endpoint supports querying by gamePks without requiring a date.

What

  • Allow gamePks schedule queries without a date in get_schedule()
  • Allow gamePks schedule queries without a date in get_scheduled_games_by_date()
  • Preserve the existing behavior when neither a date nor gamePks is provided
  • Add regression tests covering gamePks-only requests for both methods

Tests

Added regression tests in tests/test_schedule_regressions.py.

The tests verify that:

  • A gamePks-only request reaches the data adapter
  • gamePks is passed through correctly
  • The default sportId is preserved
  • No date parameters are added to the request

The tests were confirmed to fail before the fix because the adapter was never called, and pass after the change.

Full test suite passes.

Risk and impact

Risk: Minimal

The change is limited to the schedule parameter validation logic and only changes behavior when gamePks is supplied without a date. Existing date and date-range behavior is unchanged.

If something does go wrong, the impact should be limited to schedule queries involving gamePks. The added regression tests cover the affected code paths.

@Mattsface Mattsface self-assigned this Aug 10, 2026
@Mattsface
Mattsface merged commit 67fb03e into main Aug 10, 2026
6 checks passed
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.

Schedule methods reject valid gamePks queries without a date

1 participant