Skip to content

Commit

Permalink
Add check on result length before adding to cache (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjburch authored Aug 26, 2021
1 parent b448bfd commit a28f141
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pybaseball/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def _cached(*args: Any, **kwargs: Any) -> pd.DataFrame:

if result is None:
result = func(*args, **kwargs)
self._safe_save_func_cache(func_data, result)
if len(result) > 0:
self._safe_save_func_cache(func_data, result)

return result

Expand Down

0 comments on commit a28f141

Please sign in to comment.