Closed goyalyashpal closed 8 months ago
@goyalyashpal what you may have missed is that check50
uses its own specific lookup.py file and does not use the Yahoo api at all. This is done so that we always know what the price will be. So we don't need any changes. Thanks for the effort though.
hi @curiouskiwi ! thanks a lot for sharing.
umh, my check50 report is failing. and i have now no clue why.
'cz as shown in above screen recording, both in browser & in console with http status 200
it is clearly working "on my system" lol
here's the link: https://submit.cs50.io/check50/8ee4ad64886dc4fac29728a853fe20be3d18a6aa
More than likely, you haven't formatted all dollar values using the usd
jinja filter, as described in the first Hint in the specification. If that's not it, I'd suggest you post in one of our communities for further help.
ahwwww right. awesome. thanks a lot again.
edit: yeah, it passes now. thanks a lot
using the usd jinja filter, as described in the first Hint in the specification
hi!
Reason behind
i navigated to the git blame view of the file defining those checks:
there were only 2 recent commits by @ CarterZenke & @ curiouskiwi which were very small
navigating past them, i noticed that most of the checks defined there were written by @brianyu28 in month of 2020 November. https://github.com/cs50/problems/blame/bbc4dce5aad913a04fc2d6ff0092c3941d384616/finance/__init__.py#L90
So, more than 3 years ago.
And it seems to me that:
back then, the stock market api backend used was: the iexcloud.io i.e. the
Data provided by IEX
part in the distribution code of thelayout.html
... and that iex provided example dummy requests similar to how
visa
has dummy cards in thecredit
pset, or thestripe
payment gateway has dummy emails etcrecently, the api backend was changed to yahoo finance; with which the dummy request no longer returns dummy data; but rather a
400
but the checks description were not updated to match that. that's what caused the problem.
even the cs50's own implementation aka "staff solution" throws
400
error on running check50's data on it.https://github.com/cs50/problems/assets/19423063/18b3fcd2-6b5b-42fe-9a32-ae82275dfe3d
details
.quote("AAAA")
helpers.lookup()
url string to become:which
404
from this yahoo api itself. and hence,400
on itwhen given a genuinely valid symbol like
nflx
:now:
https://github.com/cs50/problems/blob/5144d41e5cc83fe5708bfacce9f1811e897867c1/finance/__init__.py#L96C1-L105