Closed znicholls closed 2 years ago
If I could get a hand adding a test that reading from the AR6 database behaves as intended that would be great
iam-units is waiting on https://github.com/IAMconsortium/units/pull/37, tests won't pass until that happens
I think the error is due to a change in pandas (https://stackoverflow.com/questions/63553845/pandas-read-json-valueerror-protocol-not-known), although I'm a bit puzzled why there is no issue with reading from the SR1.5 database as I thought the same error would occur... You could try those casting to string type solutions first, or you could just use r.json()
rather than r.text
as suggested here.
cc @danielhuppmann @phackstock and @byersiiasa
I think the error is due to a change in pandas (https://stackoverflow.com/questions/63553845/pandas-read-json-valueerror-protocol-not-known), although I'm a bit puzzled why there is no issue with reading from the SR1.5 database as I thought the same error would occur... You could try those casting to string type solutions first, or you could just use
r.json()
rather thanr.text
as suggested here.
I think the change you are refering to has been addressed in #621 ; BUT: i am not sure. ie the content attribute is a bytes string, but text has already been decoded. I'll have a short look whether i'll figure out what i think is the problem instead.
I don't encounter any error with the current main
branch. Are you sure it has not been fixed by #621 ? @znicholls
Had a second look. I am getting the same problem, you are reporting with python 3.7. Starting from python 3.8, it works fine. I guess using the json method from requests would be getting around that as you propose here.
It's not a big issue, I'll just a Python 3.9 environment. Thanks for taking a look!
Please confirm that this PR has done the following:
Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)
Please add a single line in the release notes similar to the following:
Description of PR
The downloader doesn't appear happy with the AR6 database, see below. This PR (firstly suggests a fix before hopefully) fixes that.