Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrl+f vertical, replace with diagonal #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sportsdataverse/cfb/cfb_game_rosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def helper_cfb_team_items(items, **kwargs):
for k in pop_cols:
team.pop(k, None)
team_row = pl.from_pandas(pd.json_normalize(team, sep="_"))
teams_df = pl.concat([teams_df, team_row], how="vertical")
teams_df = pl.concat([teams_df, team_row], how="diagonal")

teams_df.columns = [
"team_id",
Expand Down Expand Up @@ -131,7 +131,7 @@ def helper_cfb_roster_items(items, summary_url, **kwargs):
team_roster.columns = [col.replace("$ref", "href") for col in team_roster.columns]
team_roster.columns = [underscore(c) for c in team_roster.columns]
team_roster = team_roster.with_columns(team_id=pl.lit(tm).cast(pl.Int32))
game_rosters = pl.concat([game_rosters, team_roster], how="vertical")
game_rosters = pl.concat([game_rosters, team_roster], how="diagonal")
game_rosters = game_rosters.drop(["period", "for_player_id", "active"])
game_rosters = game_rosters.with_columns(
player_id=pl.col("player_id").cast(pl.Int64), team_id=pl.col("team_id").cast(pl.Int32)
Expand Down
8 changes: 4 additions & 4 deletions sportsdataverse/cfb/cfb_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load_cfb_pbp(seasons: List[int], return_as_pandas=False) -> pl.DataFrame:
if int(i) < 2003:
raise SeasonNotFoundError("season cannot be less than 2003")
i_data = pl.read_parquet(CFB_BASE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -65,7 +65,7 @@ def load_cfb_schedule(seasons: List[int], return_as_pandas=False) -> pl.DataFram
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(CFB_TEAM_SCHEDULE_URL.format(season=i), use_pyarrow=True, columns=None)
# data = data.append(i_data)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -92,7 +92,7 @@ def load_cfb_rosters(seasons: List[int], return_as_pandas=False) -> pl.DataFrame
if int(i) < 2004:
raise SeasonNotFoundError("season cannot be less than 2004")
i_data = pl.read_parquet(CFB_ROSTER_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -122,7 +122,7 @@ def load_cfb_team_info(seasons: List[int], return_as_pandas=False) -> pl.DataFra
i_data = pl.read_parquet(CFB_TEAM_INFO_URL.format(season=i), use_pyarrow=True, columns=None)
except Exception:
print(f"We don't seem to have data for the {i} season.")
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The expanded context confirms the potential issue with the exception handling block not accounting for cases where i_data is not defined due to an exception. This oversight could lead to a runtime error when attempting to concatenate data with an undefined i_data. The review comment is validated by the provided context.

Analysis chain

Updating to diagonal concatenation in load_cfb_team_info aligns with the PR's objectives to ensure better data integrity during the merging process. However, there's a potential issue with the exception handling block that might not account for cases where i_data is not defined due to an exception.


Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that i_data is always defined before being used in concatenation
grep -C3 "try:" sportsdataverse/cfb/cfb_loaders.py | grep -C3 "except Exception:"

Length of output: 367



Script:

#!/bin/bash
# Expand the search to include more context around the try-except block and the concatenation operation
grep -C10 "try:" sportsdataverse/cfb/cfb_loaders.py | grep -C10 "except Exception:"

Length of output: 838

return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down
2 changes: 1 addition & 1 deletion sportsdataverse/cfb/cfb_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def espn_cfb_calendar(season=None, groups=None, ondays=None, return_as_pandas=Fa
sep="_",
)

full_schedule = pl.concat([full_schedule, pl.from_pandas(reg)], how="vertical")
full_schedule = pl.concat([full_schedule, pl.from_pandas(reg)], how="diagonal")

full_schedule = full_schedule.with_columns(season=season)

Expand Down
4 changes: 2 additions & 2 deletions sportsdataverse/mbb/mbb_game_rosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def helper_mbb_team_items(items, **kwargs):
for k in pop_cols:
team.pop(k, None)
team_row = pl.from_pandas(pd.json_normalize(team, sep="_"))
teams_df = pl.concat([teams_df, team_row], how="vertical")
teams_df = pl.concat([teams_df, team_row], how="diagonal")

teams_df.columns = [
"team_id",
Expand Down Expand Up @@ -127,7 +127,7 @@ def helper_mbb_roster_items(items, summary_url, **kwargs):
team_roster.columns = [col.replace("$ref", "href") for col in team_roster.columns]
team_roster.columns = [underscore(c) for c in team_roster.columns]
team_roster = team_roster.with_columns(team_id=pl.lit(tm).cast(pl.Int32))
game_rosters = pl.concat([game_rosters, team_roster], how="vertical")
game_rosters = pl.concat([game_rosters, team_roster], how="diagonal")
game_rosters = game_rosters.drop(["period", "for_player_id", "active"])
game_rosters = game_rosters.with_columns(
player_id=pl.col("player_id").cast(pl.Int64), team_id=pl.col("team_id").cast(pl.Int32)
Expand Down
8 changes: 4 additions & 4 deletions sportsdataverse/mbb/mbb_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def load_mbb_pbp(seasons: List[int], return_as_pandas=False) -> pl.DataFrame:
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(MBB_BASE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -64,7 +64,7 @@ def load_mbb_team_boxscore(seasons: List[int], return_as_pandas=False) -> pl.Dat
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(MBB_TEAM_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -92,7 +92,7 @@ def load_mbb_player_boxscore(seasons: List[int], return_as_pandas=False) -> pl.D
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(MBB_PLAYER_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -120,5 +120,5 @@ def load_mbb_schedule(seasons: List[int], return_as_pandas=False) -> pl.DataFram
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(MBB_TEAM_SCHEDULE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data
4 changes: 2 additions & 2 deletions sportsdataverse/nba/nba_game_rosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def helper_nba_team_items(items, **kwargs):
for k in pop_cols:
team.pop(k, None)
team_row = pl.from_pandas(pd.json_normalize(team, sep="_"))
teams_df = pl.concat([teams_df, team_row], how="vertical")
teams_df = pl.concat([teams_df, team_row], how="diagonal")

teams_df.columns = [
"team_id",
Expand Down Expand Up @@ -129,7 +129,7 @@ def helper_nba_roster_items(items, summary_url, **kwargs):
team_roster.columns = [col.replace("$ref", "href") for col in team_roster.columns]
team_roster.columns = [underscore(c) for c in team_roster.columns]
team_roster = team_roster.with_columns(team_id=pl.lit(tm).cast(pl.Int32))
game_rosters = pl.concat([game_rosters, team_roster], how="vertical")
game_rosters = pl.concat([game_rosters, team_roster], how="diagonal")
game_rosters = game_rosters.drop(["period", "for_player_id", "active"])
game_rosters = game_rosters.with_columns(
player_id=pl.col("player_id").cast(pl.Int64), team_id=pl.col("team_id").cast(pl.Int32)
Expand Down
8 changes: 4 additions & 4 deletions sportsdataverse/nba/nba_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def load_nba_pbp(seasons: List[int], return_as_pandas=False) -> pl.DataFrame:
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(NBA_BASE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -64,7 +64,7 @@ def load_nba_team_boxscore(seasons: List[int], return_as_pandas=False) -> pl.Dat
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(NBA_TEAM_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -92,7 +92,7 @@ def load_nba_player_boxscore(seasons: List[int], return_as_pandas=False) -> pl.D
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(NBA_PLAYER_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -120,5 +120,5 @@ def load_nba_schedule(seasons: List[int], return_as_pandas=False) -> pl.DataFram
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(NBA_TEAM_SCHEDULE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data
4 changes: 2 additions & 2 deletions sportsdataverse/nfl/nfl_game_rosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def helper_nfl_team_items(items, **kwargs):
for k in pop_cols:
team.pop(k, None)
team_row = pl.from_pandas(pd.json_normalize(team, sep="_"))
teams_df = pl.concat([teams_df, team_row], how="vertical")
teams_df = pl.concat([teams_df, team_row], how="diagonal")
print(teams_df.columns)
teams_df.columns = [
"team_id",
Expand Down Expand Up @@ -134,7 +134,7 @@ def helper_nfl_roster_items(items, summary_url, **kwargs):
team_roster.columns = [col.replace("$ref", "href") for col in team_roster.columns]
team_roster.columns = [underscore(c) for c in team_roster.columns]
team_roster = team_roster.with_columns(team_id=pl.lit(tm).cast(pl.Int32))
game_rosters = pl.concat([game_rosters, team_roster], how="vertical")
game_rosters = pl.concat([game_rosters, team_roster], how="diagonal")
game_rosters = game_rosters.drop(["period", "for_player_id", "active"])
game_rosters = game_rosters.with_columns(
player_id=pl.col("player_id").cast(pl.Int64), team_id=pl.col("team_id").cast(pl.Int32)
Expand Down
24 changes: 12 additions & 12 deletions sportsdataverse/nfl/nfl_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def load_nfl_pbp(seasons: List[int], return_as_pandas=False) -> pl.DataFrame:
for i in tqdm(seasons):
season_not_found_error(int(i), 1999)
i_data = pl.read_parquet(NFL_BASE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -89,7 +89,7 @@ def load_nfl_schedule(seasons: List[int], return_as_pandas=False) -> pl.DataFram
# i_data = pd.read_parquet(NFL_TEAM_SCHEDULE_URL.format(season = i), engine='auto', columns=None)
i_data = read_r(download_file(schedule_url, f"{tempdirname}/nfl_sched_{i}.rds"))[None]
i_data = pl.DataFrame(i_data)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -225,7 +225,7 @@ def load_nfl_pfr_weekly_pass(seasons: List[int], return_as_pandas=False) -> pl.D
for i in tqdm(seasons):
season_not_found_error(int(i), 2018)
i_data = pl.read_parquet(NFL_PFR_WEEK_PASS_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -273,7 +273,7 @@ def load_nfl_pfr_weekly_rush(seasons: List[int], return_as_pandas=False) -> pl.D
for i in tqdm(seasons):
season_not_found_error(int(i), 2018)
i_data = pl.read_parquet(NFL_PFR_WEEK_RUSH_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -321,7 +321,7 @@ def load_nfl_pfr_weekly_rec(seasons: List[int], return_as_pandas=False) -> pl.Da
for i in tqdm(seasons):
season_not_found_error(int(i), 2018)
i_data = pl.read_parquet(NFL_PFR_WEEK_REC_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -369,7 +369,7 @@ def load_nfl_pfr_weekly_def(seasons: List[int], return_as_pandas=False) -> pl.Da
for i in tqdm(seasons):
season_not_found_error(int(i), 2018)
i_data = pl.read_parquet(NFL_PFR_WEEK_DEF_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -393,7 +393,7 @@ def load_nfl_rosters(seasons: List[int], return_as_pandas=False) -> pl.DataFrame
for i in tqdm(seasons):
season_not_found_error(int(i), 1920)
i_data = pl.read_parquet(NFL_ROSTER_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -417,7 +417,7 @@ def load_nfl_weekly_rosters(seasons: List[int], return_as_pandas=False) -> pl.Da
for i in tqdm(seasons):
season_not_found_error(int(i), 2002)
i_data = pl.read_parquet(NFL_WEEKLY_ROSTER_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -479,7 +479,7 @@ def load_nfl_snap_counts(seasons: List[int], return_as_pandas=False) -> pl.DataF
for i in tqdm(seasons):
season_not_found_error(int(i), 2012)
i_data = pl.read_parquet(NFL_SNAP_COUNTS_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -503,7 +503,7 @@ def load_nfl_pbp_participation(seasons: List[int], return_as_pandas=False) -> pl
for i in tqdm(seasons):
season_not_found_error(int(i), 2016)
i_data = pl.read_parquet(NFL_PBP_PARTICIPATION_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -527,7 +527,7 @@ def load_nfl_injuries(seasons: List[int], return_as_pandas=False) -> pl.DataFram
for i in tqdm(seasons):
season_not_found_error(int(i), 2009)
i_data = pl.read_parquet(NFL_INJURIES_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -551,7 +551,7 @@ def load_nfl_depth_charts(seasons: List[int], return_as_pandas=False) -> pl.Data
for i in tqdm(seasons):
season_not_found_error(int(i), 2001)
i_data = pl.read_parquet(NFL_DEPTH_CHARTS_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down
2 changes: 1 addition & 1 deletion sportsdataverse/nfl/nfl_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def espn_nfl_calendar(season=None, ondays=None, return_as_pandas=False, **kwargs
errors="ignore",
sep="_",
)
full_schedule = pl.concat([full_schedule, pl.from_pandas(reg)], how="vertical")
full_schedule = pl.concat([full_schedule, pl.from_pandas(reg)], how="diagonal")
full_schedule = full_schedule.with_columns(season=season)
full_schedule = full_schedule.janitor.clean_names()
full_schedule = full_schedule.rename({"week_value": "week", "season_type_value": "season_type"})
Expand Down
2 changes: 1 addition & 1 deletion sportsdataverse/nhl/nhl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ def nhl_api_schedule(start_date: str, end_date: str, return_as_pandas=False, **k
pbp_txt_games = pl.DataFrame()
for date in pbp_txt["dates"]:
game = pl.from_pandas(pd.json_normalize(date, record_path="games", meta=["date"]))
pbp_txt_games = pl.concat([pbp_txt_games, game], how="vertical")
pbp_txt_games = pl.concat([pbp_txt_games, game], how="diagonal")
return pbp_txt_games.to_pandas() if return_as_pandas else pbp_txt_games
2 changes: 1 addition & 1 deletion sportsdataverse/nhl/nhl_game_rosters.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def helper_nhl_team_items(items, **kwargs):
for k in pop_cols:
team.pop(k, None)
team_row = pl.from_pandas(pd.json_normalize(team, sep="_"))
teams_df = pl.concat([teams_df, team_row], how="vertical")
teams_df = pl.concat([teams_df, team_row], how="diagonal")

teams_df.columns = [
"team_id",
Expand Down
8 changes: 4 additions & 4 deletions sportsdataverse/nhl/nhl_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def load_nhl_pbp(seasons: List[int], return_as_pandas=False) -> pl.DataFrame:
if int(i) < 2011:
raise SeasonNotFoundError("season cannot be less than 2011")
i_data = pl.read_parquet(NHL_BASE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand All @@ -63,7 +63,7 @@ def load_nhl_schedule(seasons: List[int], return_as_pandas=False) -> pl.DataFram
if int(i) < 2002:
raise SeasonNotFoundError("season cannot be less than 2002")
i_data = pl.read_parquet(NHL_TEAM_SCHEDULE_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -91,7 +91,7 @@ def load_nhl_team_boxscore(seasons: List[int], return_as_pandas=False) -> pl.Dat
if int(i) < 2011:
raise SeasonNotFoundError("season cannot be less than 2011")
i_data = pl.read_parquet(NHL_TEAM_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down Expand Up @@ -119,7 +119,7 @@ def load_nhl_player_boxscore(seasons: List[int], return_as_pandas=False) -> pl.D
if int(i) < 2011:
raise SeasonNotFoundError("season cannot be less than 2011")
i_data = pl.read_parquet(NHL_PLAYER_BOX_URL.format(season=i), use_pyarrow=True, columns=None)
data = pl.concat([data, i_data], how="vertical")
data = pl.concat([data, i_data], how="diagonal")
return data.to_pandas(use_pyarrow_extension_array=True) if return_as_pandas else data


Expand Down
Loading
Loading