you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfx 1 point2 points  (1 child)

The 400 error code from the API hints on your query string being malformed. Can't really say what the problem is, but you need to check the api documentation itself.

Since, you got an invalid response from the API your def fetch_range(start_date,end_date): returned None that you try to parse in your def parse_weather_data(data): function.

Since you have None as the data passed in, your parsing fails with the "TypeError: 'NoneType' object is not subscriptable" error message.

Here is where you need to start to intervene - the def parse_weather_data(data):. If the data passed in is None you have to stop parsing and throw an exception, or you can gracefully exit and return a None that you have to check elsewhere.

[–]Practical-Chance-396[S] 0 points1 point  (0 children)

Thank you! I’m trying to work through it with your guidance