Why do I get only N/A in the following code in Python?
import refinitiv.dataplatform.eikon as ek
import numpy as np # NumPy
import pandas as pd # pandas
import configparser as cp
import sys
ek.set_app_key('') # here I insert app_key
import eikon as ek
df_xls = pd.read_excel(r'C:\10K.xlsx')
mylist = df_xls['RIC'].tolist()
#print(mylist)
df, err = ek.get_data(
instruments = mylist,
fields = ['MEDIAN(TR.PtoEPSMeanEst(Period=NTM,Frq=W,SDate=2016-12-15,EDate=2021-12-14))']
)
display(df)
Below you could see the result of the script:
Best Answer
-
Hi @susskaya.anita , @malashenko.i.o , @gabriel.g and @rombout
I have been advised by the Eikon Data API team that this issue has been fixed and passed their internal testing with 3000 RICS.
Please test and confirm. Thank you for your patience.
2
Answers
-
I used the code you provided and can get the data properly
Could you please try to print an error of get_data function using print(err) ?
This could be the case that you don't have an access to this data, if so, please contact your account owner regarding the entitlement or if it's any other issue, you may put the error message here and we will investigate more.
0 -
[{'code': 100, 'col': 1, 'message': 'Asynchronous Query library internal error.', 'row': 0}, {'code': 100, 'col': 1, 'message': 'Asynchronous Query library internal error.', 'row': 1},...
it is the error
0 -
It seems that it does not uderstand properly the values from xls. I don't know why.
0 -
I don't think that the problem is in the access because via Excel add-in I could retrieve that data0
-
Your XLS filename suggests you have 10K instruments in the list. If this is the case, have you tried with a smaller list of instruments in an excel file?
If you have tried a smaller list and it still fails, please convert the shorter excel file to a CSV file and attach it here so the above code snippet can be tested with your list.
1 -
You were right. The decrease of number of RIC-codes helped. However, what is the limit? Only 100 or what?0
-
The following page explains the various types of limits enforced with the Eikon Data API
Eikon Data API Usage and Limits Guideline
0 -
get_data: The current limit value (10-Oct-2019) is around 10,000 data points.
But I did not exceed that limit. Moreover, I did not have errors which are mentioned in the guideline
0 -
raksina.samasiri, I have the same issue starting this week and I had some research. This issue reproduces time from time and possibility depends on the amount of data.
The code:for RIC_num in [10,100,500]:
for n_cols in [10, 20]:
RIC_list = ric.RIC.tolist()[:RIC_num]
columns = columns_list[:n_cols]
print('RIC length:', len(RIC_list))
print('columns length:', len(columns))
for i_ in range(10):
data, err = ek.get_data(RIC_list, columns)
if err is None:
print('No error', datetime.now())
else:
print(set([e['code'] for e in err]), end=' ')
if 100 in set([e['code'] for e in err]):
print('<--- This error!', datetime.now())
else:
print(datetime.now())
The output (partly):RIC length: 100
columns length: 20
{251658243} 2021-12-16 17:47:00.936565
{251658243} 2021-12-16 17:47:08.035268
{100} <--- This error! 2021-12-16 17:47:30.244498
{100} <--- This error! 2021-12-16 17:47:50.696324
{251658243} 2021-12-16 17:47:57.530822
{251658243} 2021-12-16 17:48:05.015905
{100} <--- This error! 2021-12-16 17:48:40.422272
{251658243} 2021-12-16 17:48:50.582018
{251658243} 2021-12-16 17:48:58.884504
{251658243} 2021-12-16 17:49:08.098476
Here you can see 3 fails for 100 RICs and 20 columns.
In case of 500 RICs with 20 columns it fails in 8 out of 10 attempts:RIC length: 500
columns length: 20
{100} <--- This error! 2021-12-16 17:50:49.137280
{100} <--- This error! 2021-12-16 17:51:10.376004
{251658243} 2021-12-16 17:51:32.593595
{251658243} 2021-12-16 17:51:55.249686
{100} <--- This error! 2021-12-16 17:52:16.634033
{100} <--- This error! 2021-12-16 17:52:37.690012
{100} <--- This error! 2021-12-16 17:52:58.664758
{100} <--- This error! 2021-12-16 17:53:19.581651
{100} <--- This error! 2021-12-16 17:53:40.567594
{251658243} 2021-12-16 17:54:03.253674
I used to work with 3000 rows and it worked fine till before.2 -
I have reported this issue to the Eikon Data API team for their input.
I will report back once I hear from them.
2 -
Thank you!0
-
Hi @susskaya.anita and @malashenko.i.o
The EDAPI team have asked if you can generate logs?
import logging
ek.set_log_level(logging.DEBUG)
ek.set_app_key('your app key')and then running your script should generate a file something like pyeikon.20211217.15-28-56.log
please remove any credential information from the log file - before uploading.
e.g.
headers = {'x-tr-applicationid': 'your appkey'}
and
access_token":"eyJhbGciOiJIUzI1NiIsInR.......'
NOTE: There may well be multiple entries like the above in your log file
please search and remove all of them before uploading.
0 -
Hi @malashenko.i.o - thanks will pass this on.0
-
I am experiencing similar issues.
Snippets that worked without any problems for years keep throwing this error when calling ek.get_data:
Error code 100 | Asynchronous Query library internal error.
As far as I can tell the problems started on December 10th.
Lowering the number of instruments/fields seems to reduce the error rate. However, even when using moderately sized requests the mentioned error occurs occasionally.
1 -
the same error I usually see
0 -
Hi @susskaya.anita , @malashenko.i.o and @gabriel.g
I have copied your messages and log files to the Eikon API team.
I will update once I hear from them.
2 -
Thank you! I will wait then!0
-
Thank you so much for raising a ticket for me!
0 -
I checked the script using 1500 RICs and get NA as well. Tried the same with TR.PtoEPSMeanEst only and get all results.
My assumption is that for MEDIAN(TR.PtoEPSMeanEst(Period=NTM,Frq=W,SDate=2016-12-15,EDate=2021-12-14)) calculation, python needs to get all data points to calculate MEDIAN, so 261 separate values for each RIC that is why the limit is exceeded. Why the error message doesn't indicate the exceeded limit? I don't know,...
0 -
I don't think there is a limit restriction, because, as I posted below, you could try to get the same data in a loop and it could work sometimes (possibility depends on how big your query is). In case of limits there would be no chance for this.1
-
As you know via Formula Builder I could get results using this formula for 7500 RIC-codes. I don' think that via Formula Builder we could get more than via Python.
0 -
So why if we change the Frq from W to Y we can get all the results? I tested it for 1500 RICs and worked well0
-
Hi @lukasz.trzcinski0 - Are you referring to two different limits - one being the Eikon API limits as defined on the https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/documentation and another being the limitation of the MEDIAN call - on the backend system that EDAPI uses perhaps?
@malashenko.i.o , @gabriel.g and @susskaya.anita - Can you please confirm which country you are located in - so the EDAPI team can confirm which servers your EIKON is connecting to. - in case there is a server-side issue.
UPDATE: No need for pip freeze output. It appears the problem is server-side.
Please still confirm your location so we can identify the servers.
Thanks.
1 -
Russia, Saint Petersburg0
-
@umer.nalla Russia1
-
Austria, Vienna
connecting via EMEA servers0 -
Hi @susskaya.anita , @gabriel.g and @malashenko.i.o
Your tickets should be re-assigned to the server team - who will work with the EDAPI team to investigate further.
Hopefully, the support team will keep you updated on the progress.,
1 -
Has this already been resolved? I am getting similar error messages:
"Asynchronous Query library internal error."
1
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛