For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Response Bug in get_data

When I query multiple instruments with get_data I get an error, whereas one instrument returns data. I have included the relevant queries below. This looks like a bug or at least some odd undocumented behaviour.

eikon.get_data(
  ['0#CS-PADD1-US',],
  ['CRD_STREAM'],
  raw_output=True
)

{
  "columnHeadersCount": 1,
  "data": [
    [
      "PD1ABOCRDSLT",
      "Abo"
    ],
    [
      "PD1AGBCRDSLT",
      "Agbami"
    ],
...
  ],
  "headerOrientation": "horizontal",
  "headers": [
    [
      {
        "displayName": "Instrument"
      },
      {
        "displayName": "CRD_STREAM",
        "field": "CRD_STREAM"
      }
    ]
  ],
  "rowHeadersCount": 1,
  "totalColumnsCount": 2,
  "totalRowsCount": 187
}

Whereas querying multiple series I get field errors.

eikon.get_data(
  ['0#CS-PADD1-US', '0#CS-PADD3-US'],
  ['CRD_STREAM'],
  raw_output=True
)

{
  "columnHeadersCount": 1,
  "data": [
    [
      "0#CS-PADD1-US",
      null
    ],
    [
      "0#CS-PADD3-US",
      null
    ]
  ],
  "error": [
    {
      "code": 251658244,
      "col": 1,
      "message": "Error: Field 'CRD_STREAM' was not found in response for the instrument '0#CS-PADD1-US'",
      "row": 0
    },
    {
      "code": 251658244,
      "col": 1,
      "message": "Error: Field 'CRD_STREAM' was not found in response for the instrument '0#CS-PADD3-US'",
      "row": 1
    }
  ],
  "headerOrientation": "horizontal",
  "headers": [
    [
      {
        "displayName": "Instrument"
      },
      {
        "displayName": "CRD_STREAM",
        "field": "CRD_STREAM"
      }
    ]
  ],
  "rowHeadersCount": 1,
  "totalColumnsCount": 2,
  "totalRowsCount": 3
}

The respective payloads of the queries are

{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['0#CS-PADD1-US'], 'fields': [{'name': 'CRD_STREAM'}]}]}}}
{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['0#CS-PADD1-US', '0#CS-PADD3-US'], 'fields': [{'name': 'CRD_STREAM'}]}]}}}
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
38.1k 71 35 53

@mbert

I have tested it with the TR function in Excel and it returns:

Both 0#CS-PADD1-US and 0#CS-PADD3-US are chain RICs and a chain RIC must be requested separately.


1576476615124.png (12.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thanks @jirapongse.phuriphanvichai. From the excel API the error is informative, e.g this is a chain and must be requested seperately. Via the json / python API the erorr message is not very helpful, i.e.

"error": [
    {
      "code": 251658244,
      "col": 1,
      "message": "Error: Field 'CRD_STREAM' was not found in response for the instrument '0#CS-PADD1-US'",
      "row": 0
    },

It would probably be worth updating the backend service to have a more relevant error message similar to the Excel message?

Upvotes
38.1k 71 35 53

@mbert

I have tested with other chains RICs 0#.FTSE and 0#.SETI.

The get_data method can retrieve data for items in those chains properly. I am not sure why it doesn't work with ['0#CS-PADD1-US', '0#CS-PADD3-US']. I will contact the Eikon team to verify the problem.


1576566323594.png (21.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@jirapongse.phuriphanvichai any new info on this?

There is no response back yet. I have tried another way by submitting a new case on your behalf to the support team. The case number is 08394071.


Upvotes
38.1k 71 35 53

@mbert

We got a response back from the development team. First, I would like to explain the internal design of the get_data method.

The get_data method calls the DataGrid API to retrieve data and then the DataGrid API gets data from ADC.

0#CS-PADD1-US is a commodity index that is not supported by ADC so ADC is unable to expand this commodity index chain.

The get_data method works because the DataGrid API can expand it. However, the DataGrid API can expand only one chain RIC in the request. Therefore, specifying two commodity indices in the get_data method doesn't work.

0#.FTSE and 0#.SETI work with the get_data method because ADC can expand those RICs.

The solution, for now, is using only one chain RIC in the request.


1584080893156.png (3.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea