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

[BugFix] openbb-yfinance - Fix Key Error From Change In Response From yf.download() #6852

Merged
merged 18 commits into from
Oct 24, 2024

Conversation

deeleeramone
Copy link
Contributor

@deeleeramone deeleeramone commented Oct 23, 2024

  1. Why?:

    • New behavior by yFinance appears to have changed the shape of the response from yf.download when there is only one symbol.
      • Results in a KeyError because it is expecting a flat table response.
  2. What?:

    if len(tickers) == 1:
        data = data.get(symbol)
  1. Impact:

    • Bug fix.
    • Drops the "capital_gains", "dividend", and "split_ratio" when the sum of the column is 0 (equivalent to empty)
    • yFinance version bump.
  2. Testing Done:

    • obb.equity.price.historical("IWM", provider="yfinance")
    • obb.equity.price.historical("IWM,QQQ,AAPL", provider="yfinance", start_date="2019-01-01")

@deeleeramone deeleeramone added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels Oct 23, 2024
@deeleeramone deeleeramone changed the title [BugFix] openbb-yfinance Add Unstacking To Single Ticker Queries From yf.download [BugFix] openbb-yfinance - Fix Key Error From Change In Response When Only 1 Symbol Request From yf.download() Oct 24, 2024
@deeleeramone deeleeramone changed the title [BugFix] openbb-yfinance - Fix Key Error From Change In Response When Only 1 Symbol Request From yf.download() [BugFix] openbb-yfinance - Fix Key Error From Change In Response From yf.download() Oct 24, 2024
@deeleeramone deeleeramone added this pull request to the merge queue Oct 24, 2024
Merged via the queue into develop with commit badb4a7 Oct 24, 2024
10 checks passed
@piiq piiq deleted the bugfix/yfinance-response-change branch October 31, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants