Skip to content

Commit c8c3754

Browse files
authored
Merge pull request ranaroussi#2797 from ranaroussi/fix/unlisted-tkr-dividends-error
Fix dividends error on unlisted tickers
2 parents 65b8b6b + 7cd4735 commit c8c3754

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎tests/test_ticker.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def test_badTicker(self):
133133
assert isinstance(dat.actions, pd.DataFrame)
134134
assert dat.actions.empty
135135

136+
tkr = '6623.N'
137+
dat = yf.Ticker(tkr, session=self.session)
138+
dat.get_dividends(period="1y")
139+
dat.get_splits(period="1y")
140+
dat.get_capital_gains(period="1y")
141+
136142
def test_invalid_period(self):
137143
tkr = 'VALE'
138144
dat = yf.Ticker(tkr, session=self.session)

‎yfinance/scrapers/history.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def __init__(self, data, ticker, tz, session=None):
2525
self._history_metadata = None
2626
self._history_metadata_formatted = False
2727

28+
self._dividends = None
29+
self._splits = None
30+
self._capital_gains = None
31+
2832
# Limit recursion depth when repairing prices
2933
self._reconstruct_start_interval = None
3034

0 commit comments

Comments
 (0)