getting KeyError: 'headers' from data request

Hi, I am using the ek.get_data() function to request data, which often works but sometimes gives the following error. What is causing this and how can I resolve it? Thanks.

ERROR:

Traceback (most recent call last):

File "/usr/local/lib/python3.7/site-packages/eikon/data_grid.py", line 169, in get_data

return get_data_frame(result, field_name)

File "/usr/local/lib/python3.7/site-packages/eikon/data_grid.py", line 218, in get_data_frame

headers = [header['displayName'] for header in data_dict['headers'][0]]

KeyError: 'headers'

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    The issue with the Web service returning empty response or "Backend error. 400 Bad Request" has been addressed with the release of Eikon Data APIs library for Python v1.0.1 available on PyPI. This does not mean that with Eikon Data APIs library for Python v1.0.1 one can never receive "Bad request" error or that the service can now provide unlimited data downloads. But one should no longer experience random and frequent empty responses or "Backend error. 400 Bad Request" forcing one to resubmit the same requests in a loop until the data is returned.

Answers