AttributeError with get_news_story() in CODEBK with Dask
I am having a problem with Dask in CODEBK. Specifically, if I call get_news_story() from the Eikon API in a Dask worker I get the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-74-f3a00d0c8ed3> in <module>
21 22 for f in as_completed(fut):
---> 23 stories[f.result().id] = f.result()
/opt/conda/lib/python3.7/site-packages/distributed/client.py in result(self, timeout)
223 if self.status == "error":
224 typ, exc, tb = result
--> 225 raise exc.with_traceback(tb)
226 elif self.status == "cancelled":
227 raise result
<ipython-input-74-f3a00d0c8ed3> in __init__()
9 def __init__(self, idIn):
10 self.id = idIn;
---> 11 tmp = ek.get_news_story(self.id, raw_output=True)
12 self.headline = tmp['story']['headlineHtml']
13 self.story = tmp['story']['storyHtml']
/opt/conda/lib/python3.7/site-packages/refinitiv/dataplatform/legacy/news_request.py in get_news_story()
196 print (story)
197 """
--> 198 logger = DefaultSession.get_default_session().logger()
199 200 # check parameters type and values
AttributeError: 'NoneType' object has no attribute 'logger'
The following code in CODEBK should replicate the issue.
import refinitiv.dataplatform.eikon as ekek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')
from dask.distributed import Client, as_completedclient = Client("tcp://127.0.0.1:41045")
class story: def __init__(self, idIn):
self.id = idIn;
tmp = ek.get_news_story(self.id, raw_output=True)
self.headline = tmp['story']['headlineHtml']
self.story = tmp['story']['storyHtml']
stories = {}
fut = []
currentHeadlines = ek.get_news_headlines(query='Language:LEN', count=10)
for col, row in currentHeadlines.iterrows():
storyId = row['storyId']
fut.append(client.submit(story, storyId))
for f in as_completed(fut): stories[f.result().id] = f.result()
Tagged:
0
Best Answer
-
The error is similar to an issue when calling the get_news_story method without setting the application key.
I assume that Dask may not be able to access the ek object defined in the global.
0
Answers
-
@jirapongse.phuriphanvichai Thank you. I'll try scattering the ek object and see if that works.
0 -
I still haven't got around to checking this. I will update here when I have.
0 -
I still haven't got around to checking this. I will update here when I have
0 -
Thanks, this helped.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 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
- 367 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 中文论坛