From d45bed3d536aaf18ddc4b44b386b983a1408d9af Mon Sep 17 00:00:00 2001 From: ValueRaider Date: Sun, 9 Apr 2023 23:41:44 +0100 Subject: [PATCH] Fix 'fast_info deprecated' msg appearing at Ticker() init --- yfinance/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yfinance/base.py b/yfinance/base.py index 401b04954..10332be44 100644 --- a/yfinance/base.py +++ b/yfinance/base.py @@ -78,7 +78,7 @@ def __init__(self, ticker, session=None): self._quote = Quote(self._data) self._fundamentals = Fundamentals(self._data) - self._fast_info = FastInfo(self) + self._fast_info = None def stats(self, proxy=None): ticker_url = "{}/{}".format(self._scrape_url, self.ticker) @@ -1022,6 +1022,8 @@ def get_info(self, proxy=None) -> dict: @property def fast_info(self): + if self._fast_info is None: + self._fast_info = FastInfo(self) return self._fast_info @property