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/SIA - load function doesn't work. Error: 'NoneType' object is not subscriptable #2684

Closed
deeleeramone opened this issue Oct 1, 2022 · 7 comments · Fixed by #2723
Assignees
Labels
bug Fix bug HACKTOBERFEST Hacktoberfest

Comments

@deeleeramone
Copy link
Contributor

Recreate by entering the menu with no stock loaded, then load a ticker from any source.

Screen Shot 2022-09-30 at 8 16 50 PM

@github-actions github-actions bot added the bug Fix bug label Oct 1, 2022
@catalintoma
Copy link
Contributor

catalintoma commented Oct 1, 2022

@deeleeramone I had a quick look at this and it looks like it's intermittent. The first time I loaded I got the same error (it makes no difference if it's loaded before going to sia or after).

The reason is that we load this data from Yahoo Finance and the data (which they call summaryProfile was missing altogether).

Making it not crash with that error is trivial, but my main question is how should we report this kind of errors? I am very new to this project, but it does look like that menu cannot be used unless we know the sector, country and industry.

A good solution would be to find an alternative source if we can't find it in Yahoo Finance, can someone help me understand if we have an alternative source implemented?

@DidierRLopes DidierRLopes added the HACKTOBERFEST Hacktoberfest label Oct 2, 2022
@DidierRLopes
Copy link
Collaborator

Hmmm, @catalintoma I think you are right. We are relying on the Sector, Industry and Country from Yahoo Finance. This is also because this menu utilizes FinanceDatabase which is built on top of Yahoo Finance.

So I think it is not trivial to use another source in here, unfortunately

@colin99d colin99d self-assigned this Oct 5, 2022
@colin99d
Copy link
Contributor

colin99d commented Oct 5, 2022

Has this been fixed? I can't seem to reproduce it.

@catalintoma
Copy link
Contributor

catalintoma commented Oct 5, 2022

Has this been fixed? I can't seem to reproduce it.

As I wrote in the first comment, it is intermittent
I was able to reproduce for 2-3 times, basically that quote endpoint from YF returns
summaryProfile: {} which gets deserialized to None, hence the error message.

I want to improve the error message and refactor some duplicate code in that controller tomorrow morning, but as @DidierRLopes said we don't have an alternative source, so not that much we can do.

@colin99d
Copy link
Contributor

colin99d commented Oct 5, 2022

Sounds good! I was just wanting to replace the NoneType error with a message that is more readable to a non coder.

@catalintoma
Copy link
Contributor

@colin99d I've raised PR #2723 for this, can you help with the review?

@colin99d
Copy link
Contributor

colin99d commented Oct 6, 2022

Done!

colin99d added a commit that referenced this issue Oct 7, 2022
…#2723)

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug HACKTOBERFEST Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants