Skip to content

Commit

Permalink
Merge pull request #1498 from ranaroussi/hotfix/tz-cache-migrate-error
Browse files Browse the repository at this point in the history
Fix handling Pandas parsing error during TZ-csv-cache migrate
  • Loading branch information
ValueRaider authored Apr 16, 2023
2 parents 2c3c3dc + 8585dda commit 0baedbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yfinance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,8 @@ def _migrate_cache_tkr_tz(self):
df = _pd.read_csv(old_cache_file_path, index_col="Ticker")
except _pd.errors.EmptyDataError:
_os.remove(old_cache_file_path)
except TypeError:
_os.remove(old_cache_file_path)
else:
self.tz_db.bulk_set(df.to_dict()['Tz'])
_os.remove(old_cache_file_path)
Expand Down

0 comments on commit 0baedbe

Please sign in to comment.