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] stocks/load Concatenation error while loading a ticker #3796

Closed
kjura opened this issue Dec 17, 2022 · 12 comments
Closed

[Bug] stocks/load Concatenation error while loading a ticker #3796

kjura opened this issue Dec 17, 2022 · 12 comments
Labels
bug Fix bug

Comments

@kjura
Copy link

kjura commented Dec 17, 2022

Describe the bug
Python message shows up stating the following error "Error: can only concatenate str (not "NoneType") to str"

To Reproduce

  1. Type in the terminal: "openbb"
  2. Type "stocks"
  3. Type "load AAPL" or "load AMZN" or "load TSLA" (or any other ticker I suppose)
  4. Python error message should show up

Screenshots
bugConcatError
debugFlag

Desktop (please complete the following information):

  • OS: Ubuntu 21.10
  • Python version: 3.9.15
  • Conda: 4.12.0

Additional context
This error started to appear today, i.e Saturday December 17, 2022, CET, couple of days before there was no such behaviour, I stumbled upon this while I was investigating the cause of #3752
Commit: fb667ce

@github-actions github-actions bot added the bug Fix bug label Dec 17, 2022
@jmaslek
Copy link
Collaborator

jmaslek commented Dec 17, 2022

Looks like this is an issue with yahoo changing up their api.

There is currently a yfinance issue tracking the issue.

@deeleeramone
Copy link
Contributor

Looks like this impacts all tickers.

(🦋) /stocks/ $ load rnlsy

Loading Daily data for RNLSY with starting period 2019-12-13.
Error: can only concatenate str (not "NoneType") to str


(🦋) /stocks/ $ load spx


1 Failed download:
- SPX: No data found for this date range, symbol may be delisted

(🦋) /stocks/ $ load spy

Loading Daily data for SPY with starting period 2019-12-13.
Error: can only concatenate str (not "NoneType") to str


(🦋) /stocks/ $ load spy

Loading Daily data for SPY with starting period 2019-12-13.
Error: can only concatenate str (not "NoneType") to str


(🦋) /stocks/ $ load spy --source Polygon

Loading Daily data for SPY with starting period 2019-12-13.
Error: can only concatenate str (not "NoneType") to str

@kjura
Copy link
Author

kjura commented Dec 17, 2022

Looks like this is an issue with yahoo changing up their api.

There is currently a yfinance issue tracking the issue.

This one? ranaroussi/yfinance#1246

From the discussion it seems that they have deliberately decided to encode the data

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 17, 2022

Yup. The current workaround will be to select another source

@deeleeramone
Copy link
Contributor

deeleeramone commented Dec 17, 2022

--source is not working either, as illustrated above. SDK stocks.load works as expected.

Screenshot 2022-12-17 at 11 29 18 AM

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 17, 2022

Looking at it -- I think the additional stats are what are breaking. Seems like the download still works.

Do options and futures still work?

@deeleeramone
Copy link
Contributor

Futures, yes. Options, nope:

(🦋) /stocks/options/ $ chains --source YahooFinance

Error: float() argument must be a string or a real number, not 'NoneType'

Error: 'list' object has no attribute 'fillna'

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 17, 2022

Will need to dig but my guess is options not working because it requires getting the last price from ticker.info which is what seems to be breaking.

@ValueRaider
Copy link

ValueRaider commented Dec 18, 2022

yfinance reporting in. We've fixed the encoding problem, users testing fix now.

getting the last price from ticker.info

This is a great way to get rate-limited/blocked by Yahoo's spam detector. Use Ticker.history(period="1d") instead. I have no association with this project so will leave to you to fix.

@deeleeramone
Copy link
Contributor

So it appears that this issue is resolved with a yFinance version bump:

pip install yfinance==0.1.93

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 21, 2022

#3801 should fix this. Updates coming in the next day or so

@jmaslek jmaslek closed this as completed Dec 21, 2022
@PrayingMantis99
Copy link

So it appears that this issue is resolved with a yFinance version bump:

pip install yfinance==0.1.93

Nice!! Thx you!! Works!!

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

No branches or pull requests

5 participants