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
21 0 0 2

Problem with Power BI integration that doesn't sync real-time structures (CF_ASK, CF_LAST, etc) via Python Script

Hi everyone,


I am trying to integrate some RIC information into Power BI through python scripts that have already been tested on Refinitiv Eikon API with CodeBook. All scripts worked just fine, both historical and real-time data, as shown below.

1715686951327.png

1715686983747.png


Below are the codes used in the examples above.

1)
"import refinitiv.data as rd

rd.open_session()

rics = [

'/HOM24',

'/HON24',

'/HOQ24',

'/HOU24',

'/HOV24',

'/HOX24',

'/HOZ24',

'/HOF25',

'/HOG25',

'/HOH25',

'/HOJ25',

'/HOK24'

]

ho = rd.get_data(

universe = rics,

fields = [

'DSPLY_NAME',

'TRDPRC_1',

'PCTCHNG',

'HST_CLOSE',

'TR.ACCUMULATEDVOLUME',

'EXPIR_DATE',

'TR.FOFirstDeliveryDay',

'TR.FOLastDeliveryDay'

]

)

ho"

2)

"import refinitiv.data as rd

rd.open_session()

rics = ['BRL=']

brl = rd.get_data(

universe = rics,

fields = [

'CF_ASK',

'CF_LAST'

]

)

brl"


Historical data scripts are already integrated correctly, but real-time data scripts do not sync, as shown below.

1715687420103.png


I'm missing any step here? Thanks for all help.

eikon-data-apiworkspace#technologypython apimicrosoft-power-bi
1715686951327.png (40.3 KiB)
1715686983747.png (18.0 KiB)
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.

Hi @edu

Unfortunately, I am unable to understand what the issue is. There appears to be an image that did not render - I believe there is a maximum of 2 images that can be sent in a single question.

Could you send the missing image? I assume it is describing the issue?

Hi @nick.zincone, the problem is that the loading screen starts rendering but doesn't finish syncing the script for real-time data such as historical data.

1715704208019.png

1715704208019.png (26.6 KiB)
Upvotes
Accepted
21 0 0 2

Well, I already solved that problem too.

Nevertheless, thanks for all help.


"explanation below for all users that may have that problem in the future too"

I just discovered that the sync is capped into 5 databases as a limit bounder, so I just condensed the information requested from the get_data from all databases that I wanted into a 3 databases only. Now everything is working just fine.

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.

Upvotes
18.7k 85 39 63

Hi @edu

It's unclear where you are running your test or who produced the dialog stating "Connecting...". That is not part of the library as far as I'm aware.

When I run the entire application within a Jupyter environment, there are no issues.

1715715687324.png


1715715687324.png (68.7 KiB)
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.

Hi @nick.zincone,

The problem is not in Jupyter environment, but with Power BI. I had no problems syncing historical data like ‘TRDPRC_1’ and ‘PCTCHNG’, for example. But when I try to sync real-time data like 'CF_ASK' and 'CF_LAST', the connection screen from Power BI doesn't finish. It has been there for a long time and simply doesn't complete loading my data from the python script, that's the major problem.

Let's say the historical data is synced in a few seconds, meanwhile the real-time data just doesn't complete the loading screen connection as I mentioned before.

Upvotes
83.1k 281 53 77

@edu

You need to run Eikon or Workspace on the same machine and use the application key.

The code is:

import refinitiv.data as rd
rd.open_session(app_key="<App Key>")
rics = ['BRL=']
brl = rd.get_data(universe = rics,fields = ['CF_ASK','CF_LAST'])
session = rd.session.get_default()
session.close()
print(brl)

1715747887867.png


1715748240113.png

You can use the App Key Generator app to generate application keys. For more information, please refer to the Quick Start page.


1715747887867.png (32.4 KiB)
1715748240113.png (14.4 KiB)
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.

Hi @Jirapongse, thanks for the info.

I already tried using the app_key as a parameter into open_session, but I was using the app_key name itself which opened an error pop-up in the past, that's why I start using the open_session without a parameter and aparently it worked just fine for historical data but not for real-time data.

Since you mentioned again about the app_key, I searched again into the app_key resource from refinitiv eikon and found the api_key, which is the correct parameter to use as an app_key inside the open_session and that worked perfectly.

But now the problem is that I'm getting a handshake error because I'm already doing too many requests (SS below).

1715778894278.png

Do you hane any idea how to handle with this error?

Thanks.

1715778894278.png (45.6 KiB)

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.