-
Notifications
You must be signed in to change notification settings - Fork 32
Description
I'm using the cfbd-python library (version 5.6.11) to fetch college football data for a project. I'm encountering validation errors when calling certain functions for multiple recent seasons. More info below, thank you!
Environment:
- cfbd-python version: 5.6.11
- Python version: 3.11.9
- Operating System: Windows 11 Pro
Problem Description:
-
get_gameserrors: When callingGamesApi().get_games(year=YYYY, season_type='regular')for years 2023, 2022, and 2019, I consistently get validation errors like:Validation/Type error during schedule fetching: 9 validation errors for Game seasonType none is not an allowed value (type=type_error.none.not_allowed) startDate none is not an allowed value (type=type_error.none.not_allowed) # (Include the other field names listed in your error output) awayTeam none is not an allowed value (type=type_error.none.not_allowed)This happens even when fetching data for the full year without specific team/conference filters.
-
get_player_season_statserrors: When callingStatsApi().get_player_season_stats(year=YYYY, season_type='regular', category='passing')for years 2023, 2022, and 2019, I consistently get a validation error like:Validation/Type error during player stat fetching: 1 validation error for PlayerStat season none is not an allowed value (type=type_error.none.not_allowed)This happens even when fetching data without specific team/conference filters.
It seems the library's data models might not be handling potential null/None values returned by the API for these fields in recent years' data.
Steps to Reproduce (Example):
# Assuming API_CLIENT is configured correctly using cfbd version 5.6.11
try:
games_api = cfbd.GamesApi(API_CLIENT)
games_response = games_api.get_games(year=2022, season_type='regular')
# Error occurs here or during processing/conversion of games_response
print("Fetched games successfully?")
except Exception as e:
print(f"Error fetching games: {e}")
try:
stats_api = cfbd.StatsApi(API_CLIENT)
stats_response = stats_api.get_player_season_stats(year=2022, category='passing')
# Error occurs here or during processing/conversion of stats_response
print("Fetched stats successfully?")
except Exception as e:
print(f"Error fetching stats: {e}")