Skip to content

Commit

Permalink
Fixed nwhl.json_pbp.scrape_game function to return an empty df on error
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryShomer committed May 15, 2019
1 parent 3249208 commit c17f9bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion hockey_scraper/nwhl/json_pbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def scrape_pbp(game_id):

if not game_json:
shared.print_warning("Json pbp for game {} is not either not there or can't be obtained".format(game_id))
return None
return pd.DataFrame()

try:
game_df = parse_json(game_json, game_id)
Expand Down
1 change: 0 additions & 1 deletion hockey_scraper/nwhl/scrape_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def scrape_list_of_games(games):
if not pbp_df.empty:
pbp_dfs.append(pbp_df)
else:
# Add to broken games...
broken_games.append(game)

# If not empty...
Expand Down

0 comments on commit c17f9bc

Please sign in to comment.