Skip to content

Commit

Permalink
Merge pull request #83 from mrlimacz/yahoo-bank-holiday
Browse files Browse the repository at this point in the history
Get yahoo price series only when price is not None
  • Loading branch information
blais authored Dec 16, 2023
2 parents 2122268 + 7409c93 commit 75f07da
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 75f07da

Please sign in to comment.