C2W2A1: Batch Data Processing from API - Exercise 2 - no scheme error

Hi everyone, I’ve been stuck at this C2W2 Assignment 1 Exercise #2 for a while now, and decided to seek assistance. I’ve checked its corresponding my Exercise #1, it all seems to be working OK.

I am unsure what the “no scheme supplied” error mean here. I assume that this error is causing the following “AttributeError”?

Did I miss something in the paginated_new_releases function? If anyone is able to put me in the right direction that would be much appreciated.

I’ve attached a screenshot of the error, I hope this is OK to share.
Cheers,

Hi @voliveir - It looks like you passed an invalid URL to the API request. In the “paginated_new_releases” function, can you share how you defined kwargs and how you have defined “response” after kwargs?

Hi @hawraa.salami - In the paginated_new_releases function, I defined “kwargs” and “response” as follows:

kwargs = {
“url”: str,
“access_token”: str,
“offset”: int,
“limit”: int,
}
response = endpoint_request(**kwargs)

where can i find the solution page of this lab?

Hello @udaya_bhandarkar,
This is not a practice lab, Graded Programming Assignment 2: Batch Data Processing from an API is graded assignent and there are no solutions provided. Thank you

1 Like

Hello @voliveir,
In your dictionary you should use the values corresponding to the keys:
So you could use the same values as the keys instead (url, offset etc) You can see Exercise 3 which use the same logic as Exercise 2. Thank you

3 Likes

Hey I got the same issue today. Then I realized it’s the issue of token. The token you got from previous step only valid for 1 hour. You re-run the function to retrieve the token, and the function paginated_new_releases function should work.

1 Like

Hello @Amberzy,
That is correct it expires after 60 minutes with a 401 error. Should fix if you refresh the token, thanks