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

[Bug]: obb.etf.info("AAPL,XLE", provider="yfinance") function hangs when equity symbol and ETF symbol are combined... #7042

Open
jjfantini opened this issue Feb 25, 2025 · 15 comments · May be fixed by #7058
Labels
bug Bugs and bug fixes help wanted Extra attention is needed

Comments

@jjfantini
Copy link

jjfantini commented Feb 25, 2025

Describe the bug
WHen running obb.etf.info("AAPL,PCT,NVDA,SPY,XLE,XLF", provider="yfinance"), the function hangs for minutes and doesnt complete, not does it timeout, nor give any information on what is going on.

The function hangs as soon as an equity symbol that is not an ETF is put into the symbol parameters. You can input multiple ETF symbols, and data is returned. It used to skip the equity symbols and not return them in the DF. THis behaviour should be standardized.

If you put in just one equity symbol that is not an ETF, we get the correct error.

obb.etf.info("AAPL", provider="yfinance").to_polars()

OpenBBError: 
[Error] -> AAPL is not an ETF.

To Reproduce

from openbb import bob
obb.etf.info("AAPL,XLE,XLF", provider="yfinance")

Screenshots
Image

Desktop (please complete the following information):
Version: 0.46.4
VSCode Version: 1.96.2
Commit: db71624816f6d52f6e54f47c37cdc7df23e22620
Date: 2025-02-25T07:28:07.050Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.4.0
Python: 3.12.9
OpenBB: 4.4.0

Additional context
Add any other information that you think could be useful for us.

@jjfantini jjfantini changed the title [Bug]: obb.etf.info("AAPL,PCT,NVDA,SPY,XLE,XLF", provider="yfinance") function hangs... [Bug]: obb.etf.info("AAPL,XLE", provider="yfinance") function hangs when equity symbol and ETF symbol are combined... Feb 25, 2025
@deeleeramone
Copy link
Contributor

What version of yFinance do you have installed? If it is not the latest, you will need to update it.

Image

@jjfantini
Copy link
Author

jjfantini commented Feb 25, 2025

I have the latest version, but I am still getting the error and the function is still hanging. Can i get any other logs for you?

poetry show yfinance
 name         : yfinance                                     
 version      : 0.2.54                                       
 description  : Download market data from Yahoo! Finance API 

dependencies
 - beautifulsoup4 >=4.11.1
 - frozendict >=2.3.4
 - multitasking >=0.0.7
 - numpy >=1.16.5
 - pandas >=1.3.0
 - peewee >=3.16.2
 - platformdirs >=2.0.0
 - pytz >=2022.5
 - requests >=2.31

required by
 - lumibot requires >=0.2.54
 - openbb-yfinance requires >=0.2.54,<0.3.0
 - quantstats-lumi requires >=0.2.36

@jjfantini
Copy link
Author

Image

@deeleeramone
Copy link
Contributor

Can you use the function without to to_polars() method please, and not in a Jupyter notebook?

I'm not able to recreate, the function appears to work as expected.

Image

@jjfantini
Copy link
Author

I still ge tthe same issue when I dont use .to_polars in the Jupyter notebook. SUrely this should work in the Notebook? I use openBB quite a bit in notebooks. I have the same issue on the CLI. The functions hangs and nothing happens for minutes until the kernel crashes or I kill the terminal.

Image

@jjfantini
Copy link
Author

It's still hanging, so I am killing temrinal...

@deeleeramone
Copy link
Contributor

This seems like a network or other type of issue related to your system configuration. There's not really anything to "hang" except for HTTP requests. An incorrectly configured proxy network will cause this type of thing to happen.

How are you connected to the internet? What environment variables to you set? What are all the other factors?

Have you already tried deleting your environment, cleared your caches, and built a new one?

@jjfantini
Copy link
Author

I am connected to WiFi. I have no proxy connections. I haven't set any environment variables. I can try rebuilding my environment.

@deeleeramone
Copy link
Contributor

What does the error message say when you cancel the process?

@jjfantini
Copy link
Author

I don't get an error when I cancel the process, I have to kill the terminal. control + c doesnt work.

@deeleeramone
Copy link
Contributor

Something I have actually been running into with VS Code itself recently is somewhat similar behavior to what you describe. Sometimes doing anything at all in the terminal hangs it - like activating the environment or pip install anything.

That's about the closest I can get to being able to recreate the issue. Maybe try with a different terminal, code/jupyter interface, entirely.

@deeleeramone
Copy link
Contributor

I might have found something attributable to the Python Environments extension in VS Code. The existing extension for this is now deprecated, and the new one is in "pre-release only".

@jjfantini
Copy link
Author

Hmmm, I havent experienced that with any other command that I have been running, just this ebb command. I have this function being served via an API onRender, and the applications also hangs on there as well, nothing to do with VSCode.

@deeleeramone
Copy link
Contributor

deeleeramone commented Mar 7, 2025

okay, I can reproduce in Colab. Not clear what the issue is, running the code that does all the work executes. Putting 2+2 together, Chromium + Colab....

Image

Image

Image

@deeleeramone deeleeramone added bug Bugs and bug fixes help wanted Extra attention is needed labels Mar 7, 2025
@deeleeramone
Copy link
Contributor

I think I got it here, @jjfantini, please let me know if you are able to test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and bug fixes help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants