Skip to content

Commit

Permalink
Get yahoo price series only when price is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlimacz committed Nov 13, 2023
1 parent 2122268 commit 7409c93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beanprice/sources/yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def get_price_series(ticker: str,
timestamp_array = result['timestamp']
close_array = result['indicators']['quote'][0]['close']
series = [(datetime.fromtimestamp(timestamp, tz=tzone), Decimal(price))
for timestamp, price in zip(timestamp_array, close_array)]
for timestamp, price in zip(timestamp_array, close_array)
if price is not None]

currency = result['meta']['currency']
return series, currency
Expand Down

0 comments on commit 7409c93

Please sign in to comment.