Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticker.growth_estimates error #2126

Open
kschubert417 opened this issue Nov 14, 2024 · 0 comments
Open

ticker.growth_estimates error #2126

kschubert417 opened this issue Nov 14, 2024 · 0 comments

Comments

@kschubert417
Copy link

Describe bug

Yesterday (November 14, 2024) everything was running fine, this morning I have run into errors when trying to retrieve growth estimates from Microsoft (ticker MSFT).

Here is the error code:

Traceback (most recent call last):
  File "c:/python/utility-roe/web/app/functions.py", line 497, in <module>
    print(msft.growth_estimates)
  File "C:\Python37\lib\site-packages\yfinance\ticker.py", line 278, in growth_estimates
    return self.get_growth_estimates()
  File "C:\Python37\lib\site-packages\yfinance\base.py", line 308, in get_growth_estimates
    data = self._analysis.growth_estimates
  File "C:\Python37\lib\site-packages\yfinance\scrapers\analysis.py", line 225, in growth_estimates
    data_dict[period].append(item.get('growth', {}).get('raw', None))
KeyError: 'LTG'

Simple code that reproduces your problem

Here is the example from the https://pypi.org/project/yfinance/ page I am no longer able to run without error.

import yfinance as yahooFinance

msft = yahooFinance.Ticker("MSFT")
print(msft.info) # works
print(msft.growth_estimates) # where error occurs

Debug log

DEBUG    get_raw_json(): https://query2.finance.yahoo.com/v10/finance/quoteSummary/MSFT
DEBUG    Entering get()
DEBUG     Entering _make_request()
DEBUG      url=https://query2.finance.yahoo.com/v10/finance/quoteSummary/MSFT
DEBUG      params={'modules': 'earningsTrend', 'corsDomain': 'finance.yahoo.com', 'formatted': 'false', 'symbol': 'MSFT'}
DEBUG      Entering _get_cookie_and_crumb()
DEBUG       cookie_mode = 'basic'
DEBUG       Entering _get_cookie_and_crumb_basic()
DEBUG        reusing cookie
DEBUG        reusing crumb
DEBUG       Exiting _get_cookie_and_crumb_basic()
DEBUG      Exiting _get_cookie_and_crumb()
DEBUG      response code=200
DEBUG     Exiting _make_request()
DEBUG    Exiting get()
DEBUG    get_raw_json(): https://query2.finance.yahoo.com/v10/finance/quoteSummary/MSFT
DEBUG    Entering get()
DEBUG     Entering _make_request()
DEBUG      url=https://query2.finance.yahoo.com/v10/finance/quoteSummary/MSFT
DEBUG      params={'modules': 'industryTrend,sectorTrend,indexTrend', 'corsDomain': 'finance.yahoo.com', 'formatted': 'false', 'symbol': 'MSFT'}
DEBUG      Entering _get_cookie_and_crumb()
DEBUG       cookie_mode = 'basic'
DEBUG       Entering _get_cookie_and_crumb_basic()
DEBUG        reusing cookie
DEBUG        reusing crumb
DEBUG       Exiting _get_cookie_and_crumb_basic()
DEBUG      Exiting _get_cookie_and_crumb()
DEBUG      response code=200
DEBUG     Exiting _make_request()
DEBUG    Exiting get()

Bad data proof

No response

yfinance version

0.2.49

Python version

3.7

Operating system

Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant