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

Fix the fetching of fundamentals #480

Merged
merged 1 commit into from
Jan 18, 2021
Merged

Fix the fetching of fundamentals #480

merged 1 commit into from
Jan 18, 2021

Conversation

PaulRenvoise
Copy link
Contributor

As of now, the fetching of fundamentals is broken for some (all?) tickers (e.g. BIM.PA, AF.PA, IBM, etc.).

The reason for that is located in the _get_fundamentals method implemented in base.py, between the lines 280 and 285: the url var (containing the base_url and the ticker) has "/holders" appended, and when fetching the fundamentals, only "/financials" is appended again, instead of replacing "/holders".

This PR fixes the issue.

Before:

import yfinance as yf

yf.Ticker('BIM.PA').earnings
#=> Empty DataFrame
#=> Columns: [Open, High, Low, Close, Adj Close, Volume]
#=> Index: []

After:

import yfinance as yf

yf.Ticker('BIM.PA').financials
#=>          Revenue   Earnings
#=> Year
#=> 2016  2103200000  179100000
#=> 2017  2288200000  238100000
#=> 2018  2421300000  256500000
#=> 2019  2674800000  272800000

@PaulRenvoise
Copy link
Contributor Author

Closes #191, #465, #474, #475, #423, #419

@muran123
Copy link

Thank you. Your fix solved the isuee. Would be great to have it in the next release.

@sedziwoj
Copy link

So when is next release, because I change it by hand, and this bug blocking useful informations.

@mvanaltvorst
Copy link

This PR works great, I am not sure why it isn't merged yet.

@ravidparikh92
Copy link

I am still facing this issue. When will it be fixed in the next release. Thank you.

@jiayanguo
Copy link

Ya, I am facing the same issue.

@Charmik
Copy link

Charmik commented Jan 10, 2021

can you merge this MR? it's commited in October

Copy link

@jeremyleonardo jeremyleonardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the problem for me

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

Successfully merging this pull request may close these issues.

10 participants