Issue with datetime64 Conversion in Eikon API – Assistance Required

Hello Eikon Developer Team,
I am encountering an issue when using the ek.get_news_headlines()
function in the Eikon API. Recently, when fetching news headlines in my project, the following traceback error has started to occur:
Traceback (most recent call last):
File "main_8.py", line [105], in <module>
df_new = ek.get_news_headlines(
File "venv/lib/site-packages/eikon/news_request.py", line 126, in get_news_headlines
return get_data_frame(result)
File "venv/lib/site-packages/eikon/news_request.py", line 144, in get_data_frame
headlines_dataframe = pd.DataFrame([], numpy.array(first_created, dtype='datetime64'), Headline_Selected_Fields)
...
TypeError: datetime64 values must have a unit specified
It appears that the error is occurring during the conversion of datetime arrays. For context, I’m currently using NumPy version 1.26.2—which meets pandas’ dependency requirements (numpy>=1.22.4, <2.0
). This issue did not occur in my previous setup, and I suspect it might be related to changes in how NumPy handles datetime64
dtypes (i.e., requiring an explicit time unit).
Could you please advise on the following:
- Is there a known compatibility issue with the current version of the Eikon API and NumPy 1.26.2?
- What version of NumPy is officially supported or recommended for use with the current version of the Eikon API?
- Would you recommend a temporary workaround (e.g., downgrading NumPy to an earlier version such as 1.22.4) until a patch is released, or is there another fix for this issue?
Thank you very much for your assistance and guidance on this matter.
Best regards,
Vishwesh1
Answers
-
Thank you for reaching out to us.
I can replicate this issue. I saw this error when there is no returned headline.
You can use the following statement to check the response.
ek.set_log_level(1) ek.get_news_headlines('ORDER IMBALANCE', date_from='2024-10-19T00:00:00', date_to='2024-10-19T23:59:59', count=100)
2025-04-09 12:47:38,054 P[19848] [MainThread 45536] HTTP Response code: 200
2025-04-09 12:47:38,054 P[19848] [MainThread 45536] HTTP Response: {"headlines":[],"newer":"/headlines?payload=eyJxd…It will work fine if there are returned headlines.
ek.get_news_headlines("ALL", count=100)
You can try the LSEG Data Library for Python instead. The news example is on GitHub.
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
- 684 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
- 249 ETA
- 554 WebSocket API
- 37 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
- 643 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 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 中文论坛