-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Expense ratio for ETFs .info returns None #244
Comments
ycc1107
added a commit
to ycc1107/yfinance
that referenced
this issue
Apr 8, 2020
read fundProfile and populate to info
The issue code did not go to the |
johnnymo87
pushed a commit
to johnnymo87/yfinance
that referenced
this issue
Jan 17, 2021
read fundProfile and populate to info
johnnymo87
added a commit
to johnnymo87/yfinance
that referenced
this issue
Jan 17, 2021
As reported in issue ranaroussi#244, there is a bug with querying for an ETF's expense ratio. For mutual funds, this value is found in `.info['annualReportExpenseRatio']`, but for ETFs it is not. ```py >>> import yfinance as yf >>> print(yf.Ticker('VTSAX').info['annualReportExpenseRatio']) 0.0004 >>> print(yf.Ticker('VTI').info['annualReportExpenseRatio']) None ``` The github user @ycc1107 commented on the issue, identifying the root cause, which is that for some reason this value is only available inside the `'fundProfile'` key of the `data` dictionary, a key that is only present when querying mutual funds and ETFs. The `'fundProfile'` key leads to a dictionary with a `'feesExpensesInvestment'` key, which leads to a dictionary with an `'annualReportExpenseRatio'` key, which has the value we need. The github user @ycc1107 opened a PR to fix this issue, but I'm concerned that it changes too much, as it recursively merges the entirety of the `'fundProfile'` dictionary into the `.info` dictionary. So I'm proposing an alternative fix here that attempts to write only `.info['annualReportExpenseRatio']` and nothing else.
johnnymo87
added a commit
to johnnymo87/yfinance
that referenced
this issue
Feb 5, 2021
As reported in issue ranaroussi#244, there is a bug with querying for an ETF's expense ratio. For mutual funds, this value is found in `.info['annualReportExpenseRatio']`, but for ETFs it is not. ```py >>> import yfinance as yf >>> print(yf.Ticker('VTSAX').info['annualReportExpenseRatio']) 0.0004 >>> print(yf.Ticker('VTI').info['annualReportExpenseRatio']) None ``` The github user @ycc1107 commented on the issue, identifying the root cause, which is that for some reason this value is only available inside the `'fundProfile'` key of the `data` dictionary, a key that is only present when querying mutual funds and ETFs. The `'fundProfile'` key leads to a dictionary with a `'feesExpensesInvestment'` key, which leads to a dictionary with an `'annualReportExpenseRatio'` key, which has the value we need. The github user @ycc1107 opened a PR to fix this issue, but I'm concerned that it changes too much, as it recursively merges the entirety of the `'fundProfile'` dictionary into the `.info` dictionary. So I'm proposing an alternative fix here that attempts to write only `.info['annualReportExpenseRatio']` and nothing else.
johnnymo87
added a commit
to johnnymo87/yfinance
that referenced
this issue
Mar 14, 2021
As reported in issue ranaroussi#244, there is a bug with querying for an ETF's expense ratio. For mutual funds, this value is found in `.info['annualReportExpenseRatio']`, but for ETFs it is not. ```py >>> import yfinance as yf >>> print(yf.Ticker('VTSAX').info['annualReportExpenseRatio']) 0.0004 >>> print(yf.Ticker('VTI').info['annualReportExpenseRatio']) None ``` The github user @ycc1107 commented on the issue, identifying the root cause, which is that for some reason this value is only available inside the `'fundProfile'` key of the `data` dictionary, a key that is only present when querying mutual funds and ETFs. The `'fundProfile'` key leads to a dictionary with a `'feesExpensesInvestment'` key, which leads to a dictionary with an `'annualReportExpenseRatio'` key, which has the value we need. The github user @ycc1107 opened a PR to fix this issue, but I'm concerned that it changes too much, as it recursively merges the entirety of the `'fundProfile'` dictionary into the `.info` dictionary. So I'm proposing an alternative fix here that attempts to write only `.info['annualReportExpenseRatio']` and nothing else.
This was referenced Sep 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'annualReportExpenseRatio' is working fine for mutual funds but not for ETFs.
The text was updated successfully, but these errors were encountered: