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.fund_sector_weightings - KeyError: 'None of [0] are in the columns' #278

Open
kabl opened this issue May 17, 2024 · 0 comments
Open

Comments

@kabl
Copy link

kabl commented May 17, 2024

Describe the bug
First of all thank you for this amazing library 👍

For some ETFs especial Bond based ETFs fund_sector_weightings is throwing an exception.
Even when there are multiple symbols in the ticker and just one of them makes trouble (is a Bond based ETF) an exception is thrown.

To Reproduce

from yahooquery import Ticker
import yahooquery

print(yahooquery.__version__)
# > 2.3.7

ticker = Ticker(["IBDX"])
ticker.fund_sector_weightings
# > KeyError: 'None of [0] are in the columns'

# OR 
ticker = Ticker(["IBDX", "SPY"])
ticker.fund_sector_weightings
# > KeyError: 'None of [0] are in the columns'

Expected behavior
No exception. E.g.

ticker = Ticker(["IBDX"])
ticker.fund_sector_weightings

"
0","IBDX
"
realestate,0.0
consumer_cyclical,0.0
basic_materials,0.0
consumer_defensive,0.0
technology,0.0
communication_services,0.0
financial_services,0.0
utilities,0.0
industrials,0.0
energy,0.0
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