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

IndexError for on yf.Ticker('NEPT').info. #2363

Open
Fotoblysk opened this issue Mar 15, 2025 · 1 comment
Open

IndexError for on yf.Ticker('NEPT').info. #2363

Fotoblysk opened this issue Mar 15, 2025 · 1 comment

Comments

@Fotoblysk
Copy link

Describe bug

The error is likely here as result is empty:

        query1_info = {}
        for quote in ["quoteSummary", "quoteResponse"]:
            if quote in result:
                result[quote]["result"][0]["symbol"] = self._symbol # MY_COMENT - HERE RESULT IS [] FOR quote="quoteResponse"
                query_info = next(
                    (info for info in result.get(quote, {}).get("result", [])
                     if info["symbol"] == self._symbol),
                    None,
                )
                if query_info:
                    query1_info.update(query_info)

Simple code that reproduces your problem

import yfinance as yf
print(yf.version)
print(yf.Ticker('NEPT').info)

Debug log from yf.enable_debug_mode()

Not needed.

Bad data proof

Not bad data just bad exception handling

yfinance version

0.2.54

Python version

3.12.3

Operating system

Ubuntu

@dhruvan2006
Copy link
Contributor

Should be fixed by #2354. Can you check?

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

2 participants