Failed returns on get_data

I have a routine that has been running fine for several months but now fails if I pass yesterdays date as a parameter, but if I pass the prior sessions date it works fine.
It seems that the data is not prepared for yesterday's session yet. Usually it runs successfully in the mid evening for New York and Toronto. Sometimes we need to wait, but it is always ready in the morning.
C:\PNC\Stats\Python>python.exe GetHighsLows.py High XNYS 20220418 -> FAILS
C:\PNC\Stats\Python>python.exe GetHighsLows.py High XNYS 20220414 ->SUCCEEDS
In ther traceback below, it suggests the header is not being found in yesterday's data.
Any ideas?
C:\PNC\Stats\Python>python.exe GetHighsLows.py High XNYS 20220418
Traceback (most recent call last):
File "C:\PNC\Stats\Python\GetHighsLows.py", line 13, in <module>
df, err = ek.get_data(instrument,['TR.CommonName','TR.PRICECLOSE'])
File "C:\Users\PC3\AppData\Local\Programs\Python\Python39\lib\site-packages\refinitiv\dataplatform\legacy\data_grid.py", line 224, in get_data
return get_data_frame(result, field_name)
File "C:\Users\PC3\AppData\Local\Programs\Python\Python39\lib\site-packages\refinitiv\dataplatform\legacy\data_grid.py", line 278, in get_data_frame
headers = [header["displayName"] for header in data_dict["headers"][0]]
KeyError: 'headers'
C:\Users\PC3\AppData\Local\Programs\Python\Python39\lib\site-packages\httpx\_client.py:2012: UserWarning: Unclosed <httpx.AsyncClient object at 0x000002814ED6A280>. See https://www.python-httpx.org/async/#opening-and-closing-clients for details.
Best Answer
-
Hi @dgarrard,
I believe that this is a content-related question. The API is behaving as expected - I tested it myself.
The best resource for content questions is the Refinitiv Helpdesk, which can be reached by either calling the Helpdesk number in your country or submitting a new ticket to the support team via MyRefinitiv.
0
Answers
-
Here is the script:
import sys
import refinitiv.dataplatform.eikon as ek
import pandas
ek.set_app_key()
DataSwitch_T = sys.argv[1] # High, Low
Exch_T = sys.argv[2] # XNYS, XTSE
Date_T = sys.argv[3] # 20211203
# EIKON QUERY
instrument = "SCREEN(U(IN(Equity(active,public,primary,countryprimaryquote))),IN(TR.ExchangeMarketIdCode,'" + Exch_T + "'),BETWEEN(TR.Price52Week"+DataSwitch_T+"Date," + Date_T + "," + Date_T + "))"
df, err = ek.get_data(instrument,['TR.CommonName','TR.PRICECLOSE'])
file1 = open('C:\PNC\Logs\MIA_'+DataSwitch_T+'_'+Exch_T+'_'+ Date_T +'.txt', 'w')
df.to_csv(file1, index=False)
file1.close()
new_df = pandas.read_csv('C:\PNC\Logs\MIA_'+DataSwitch_T+'_'+Exch_T+'_'+ Date_T +'.txt')
print('~Beginning of Data\n')
print(new_df)
print('\n~End of Data')0 -
This was an Eikon service (not specifically API) outage which lasted for about 4 days. It has since come back on line.
0 -
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛