Closed brohr closed 1 year ago
@brohr, thank you for bringing this up. Sorry for the delayed response!
The client normally takes care of chunking requests to avoid hitting the URL length limit, so I will investigate why that isn't happening here.
@brohr, this is actually a bug that was fixed last week in the mpcontribs-client
package. If you update that to the latest version, you should be good to go.
Description I was trying to get the pourbaix entries for a few chemical systems, and the api responded with a 400 error indicating that the URL was too long.
After looking into it a little further, it appears that the problem arises when MPRester's get_ion_reference_data method is called. This calls the query_contributions method, which appears to construct one or many GET requests, and due to the number of IDs in the GET request, the URL is too long.
Ultimately, you can see the response status code and message in _run_futures when that method is called. An HTTPException is not raised, so the program crashes with a KeyError when the response is passed back to the query_contributions method, which expects the response to have the key "result," which it does not.
To Reproduce the Error
Full Traceback