How to use MPRester.get_task_data?

Hello

I want to use MPRester.get_task_data, but an error occurs.

with MPRester(api_key) as m:
    a=m.get_task_data("mp-48")

The error is as follows:

MPRestError: 'NoneType' object is not iterable. Content: b'{"valid_response": false, "error": "\'NoneType\' object is not iterable", "version": {"db": "3.0.0", "pymatgen": "2018.7.23", "rest": "2.0"}, "created_at": "2018-08-29T17:43:36.537135", "traceback": "Traceback (most recent call last):\\n  File \\"/var/www/python/matgen_prod/materials_django/rest/rest.py\\", line 94, in wrapped\\n    d = func(*args, **kwargs)\\n  File \\"/var/www/python/matgen_prod/materials_django/tasks/rest.py\\", line 47, in get_property\\n    entries = qe.get_entries(crit, False, supported_task_properties)\\n  File \\"/var/www/miniconda3/envs/mpprod3/lib/python3.6/site-packages/matgendb/query_engine.py\\", line 305, in get_entries\\n    symbols = [\\"{} {}\\".format(func, label) for label in labels]\\nTypeError: \'NoneType\' object is not iterable\\n"}'

I tried it with other mids, but the same error occurs.
What’s wrong with this code?
Or is it a bug?

1 Like

Yes, there was a backend bug related to our recent infrastructure overhaul. Thanks for catching this! It’s fixed now – try again.

1 Like