cs50 / problems

Checks for check50
134 stars 227 forks source link

finance check "handles valid ticker symbol" is actually using "invalid ticker symbol" #218

Closed goyalyashpal closed 8 months ago

goyalyashpal commented 8 months ago

hi!

Reason behind

image

And it seems to me that:

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

https://query1.finance.yahoo.com//v7/finance/download/AAAA?period1=1703103695&period2=1703708495&interval=1d&events=history&includeAdjustedClose=true
DEBUG: Starting new HTTPS connection (1): query1.finance.yahoo.com:443
DEBUG: https://query1.finance.yahoo.com:443 "GET /v7/finance/download/AAAA?period1=1703103695&period2=1703708495&interval=1d&events=history&includeAdjustedClose=true HTTP/1.1" 404 52

which

when given a genuinely valid symbol like nflx:

now:

https://github.com/cs50/problems/blob/5144d41e5cc83fe5708bfacce9f1811e897867c1/finance/__init__.py#L96C1-L105

curiouskiwi commented 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.

goyalyashpal commented 8 months ago

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

curiouskiwi commented 8 months ago

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.

goyalyashpal commented 8 months ago

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