Problem with refinitiv-data.config.json for refinitiv-data library

I have made changes to refinitiv-data.config.json file, but it seems they are not taken over. How to test whether the config is proper considered.
Project structure:
My config file is as follows:
{
"sessions": {
"default":"platform.rdp",
"platform": {
"rdp": {
"app-key": "xxx",
"username": "xxx",
"password": "xxx"
}
}
},
"apis": {
"data": {
"datagrid": {
"underlying-platform": "udf"
}
}
}
}
and I am trying to open a session:
import os
os.environ["RD_LIB_CONFIG_PATH"] = "./Configuration"
import refinitiv.data as rd
from refinitiv.data.content import fundamental_and_reference
import datetime
rd.open_session() -> error here:
[Error 401] - {'error': 'invalid_client', 'error_description': 'Invalid Application Credential.'}
<refinitiv.data.session.Definition object at 0x1d196f09e50 {name='rdp'}>
When I use the same credentials directly with :
session = rd.session.platform.Definition(
app_key='xxx',
grant=rd.session.platform.GrantPassword(
username= "xxx",
password="xxx"
)
).get_session()
session.open()
rd.session.set_default(session) -> I get my session opened and I also get data from
response = fundamental_and_reference.Definition(
["TRI.N", "IBM.N"],
["TR.Revenue", "TR.GrossProfit"]
).get_data()
response.data.df
I want to use config file as I am testing the differences in outputs between UDF Datagrid and RDP Datagrid
Best Answer
-
Hello @Anastasiia.Shcherbak
As mentioned by my colleague, the Platform Session does not support the UDF. You need to use the Desktop Session (the Workspace/Eikon desktop application is required).
I did a quick test with the Desktop Session as follows:
"sessions": {
"default": "desktop.workspace",
"desktop": {
"workspace": {
"app-key": "App_Key"
}
}
}Result:
Then when I tested with the Platform Session:
"sessions": {
"default": "platform.platform",
"platform": {
"rdp": {
"app-key": "App Key",
"username": "User ID",
"password": "Password",
"auto-reconnect": true,
"server-mode": true,
"signon_control": true
}
}
}Result:
0
Answers
-
Thank you for reaching out to us.
For readability, the code and configurations should be posted in the code block.
I have tested the configuration and it worked fine.
You may need to enable logging in the library to verify what the problem is by using the following code.
config = rd.get_config()
config.set_param("logs.transports.file.enabled", True)
config.set_param("logs.transports.file.name", "refinitiv-data-lib.log")
config.set_param("logs.level", "debug")
rd.open_session()Then, the refinitiv-data-lib.log file will be created. Please share this log file.
I found the following message in the log file.
[2024-05-03T17:00:33.267845+07:00] - [sessions.platform.rdp.0] - [DEBUG] - [109384 - MainThread] - [_definition] - [_update_content_type] - UDF DataGrid service cannot be used with platform sessions, RDP DataGrid will be used instead. The "/apis/data/datagrid/underlying-platform = 'udf'" parameter will be discarded, meaning that the regular RDP DataGrid service will be used for Fundamental and Reference data requests.
This indicates that the platform.rdp session doesn't support UDF DataGrid.
0 -
I am getting the following log:
[2024-05-03T12:51:11.215357+02:00] - [sessions.platform.rdp.17] - [DEBUG] - [8728 - MainThread] - [_platform_session] - [_connection] - Created session connection SessionCxnType.REFINITIV_DATA
[2024-05-03T12:51:11.217347+02:00] - [sessions.platform.rdp.17] - [DEBUG] - [8728 - MainThread] - [_session_provider] - [session_provider] - + Session created: PlatformSession
name = 'rdp'
connection = RefinitivDataConnection
stream_auto_reconnection = True
authentication_token_endpoint_url = https://api.refinitiv.com/auth/oauth2/v1/token
signon_control = True
server_mode = False
state = OpenState.Closed
session_id = 17
logger_name = sessions.platform.rdp.17What would be then the config to be able to use udf? Something like below did not work for me:
{
"sessions": {
"platform": {
"default": {
"app-key": "APP_KEY",
"username": "USERNAME",
"password": "PASSWORD",
"auto-reconnect": true,
"server-mode": true,
"signon_control": true
}
}
},
"apis": {
"data": {
"datagrid": {
"underlying-platform": "udf"
}
}
}
}0 -
As far as I know, the UDF works with the desktop.workspace. You need to run Eikon or Workspace on the maching to use the desktop.workspace session.
"default": "desktop.workspace",
Moreover, no need to overide it on the configuration file.
Please use the configuration file 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
- 613 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
- 248 ETA
- 552 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
- 637 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
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 88 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛