Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
23 7 2 9

TR_field results in bad request in get_data

Hello,

I've noticed that when I build my TR_fields with the help function I get different results than if I would send the fields as a list of strings to get_data.

params = {"instruments": ["BKOM.PR"], "fields": ["TR.NetIntMarginActual.date", "TR.NetIntMarginActual"], "parameters":{"SDate":0, "EDate":-5, "Period":"FQ0", "Frq":"FQ"}}

fields = [ek.TR_Field(f) for f in params['fields']]
params['fields'] = fields

df, err = ek.get_data(**params)

results in a '400 Bad Request' whilst

params = {"instruments": ["BKOM.PR"], "fields": ["TR.NetIntMarginActual.date", "TR.NetIntMarginActual"], "parameters":{"SDate":0, "EDate":-5, "Period":"FQ0", "Frq":"FQ"}}

df, err = ek.get_data(**params)

gets no error. However, changing the field order of the first query as such

params = {"instruments": ["BKOM.PR"], "fields": ["TR.NetIntMarginActual", "TR.NetIntMarginActual.date"], "parameters":{"SDate":0, "EDate":-5, "Period":"FQ0", "Frq":"FQ"}}

fields = [ek.TR_Field(f) for f in params['fields']]
params['fields'] = fields

df, err = ek.get_data(**params)

also doesn't result in an error. Could you give some insight in how the sorting is done at the TR server side? From what I've seen it sorts on the first field.

On a further note I want to report a bug that I found yesterday (and posted in the forum elsewhere but I'd figure I could repeat it here). In the file data_grid.py -> TR_Field it says that the highest priority is 0. However, when it does the check

if sort_priority:field[field_name]['sort_priority'] = sort_priority

a priority of 0 will result in the if evaluating to False, thus giving it no priority.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apidata
icon clock
10 |1500

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

Asked Pierre Faurel and Iain Scott if we can acknowledge this issue as a bug and whether we can give any indication when the fix might be expected.

Sent another e-mail to Iain Scott.

@Alex Putkov. Do you have any update from Iain or Pierre?

@Alex Putkof @Pierre Fuarel @Iain Scott do you have any updates?

Hello @thomas.kourim,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks

-AHS

Show more comments

1 Answer

· Write an Answer
Upvote
Accepted
4.3k 2 4 5

The issue related to sort_priority management was fixed by development team.

The last 0.1.10 eikon API version includes it.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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