Skip to content

Commit

Permalink
Fix 'tradingPeriods' parsing when empty - 0.2.10b2
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Feb 1, 2023
1 parent d47133e commit 2a2928b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions yfinance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@ def format_history_metadata(md):
del md["currentTradingPeriod"][m]["gmtoffset"]
del md["currentTradingPeriod"][m]["timezone"]

if "tradingPeriods" in md:
if md["tradingPeriods"] == {"pre":[], "post":[]}:
del md["tradingPeriods"]

if "tradingPeriods" in md:
tps = md["tradingPeriods"]
if isinstance(tps, list):
Expand Down
2 changes: 1 addition & 1 deletion yfinance/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.2.10b1"
version = "0.2.10b2"

0 comments on commit 2a2928b

Please sign in to comment.