Cannot open lseg data session

Hello,
I'm trying to migrate my scripts from refinitiv-data api so the LSEG-data api.
I'm trying to create a plateform session, using a lseg-data.config.json file.
I first read that config file, using
ld.open_session(config_name = "lseg-data.config.json")
.
But when trying to test my connection using a simple API call, like
ld.get_history("AAPL.O")
I get
LDError: No data to return, please check errors: ERROR: No successful response.(401, Authorization header is missing)
Here is my config file :
{
"http": {
"request-timeout": 60
},
"logs": {
"level": "debug",
"transports": {
"console": {
"enabled": false
},
"file": {
"enabled": false,
"name": "lseg-data-lib.log"
}
}
},
"sessions": {
"default": "platform.ldp",
"platform": {
"ldp": {
"app-key": "appkey",
"username": "username",
"password": "password",
"signon_control": true
},
"deployed": {
"app-key": "appkey",
"realtime-distribution-system": {
"url": "ws://ADS1:15000",
"dacs": {
"username": "username",
"application-id": id,
"position": ""
}
}
}
},
"desktop": {
"workspace": {
"app-key": "appkey"
}
}
}
}
Anyone has an idea of what i'm missing ?
Thank you.
Best Answer
-
Hi,
Thanks for the tip, updating my pandas does the trick.
Thank you,
Best,
0
Answers
-
Hello @adam.leroux
You have debugging enabled - please paste the complete log messages. Are you able to create and open the session successfully? You can try one of the basic examples here.
0 -
Hello Gurpeet, thank you for your answer,
I have been able to open a session using :
session = ld.session.platform.Definition( app_key = appkey, grant = ld.session.platform.GrantPassword( username = username, password = pwd ), signon_control=True).get_session().
As you can see in this part of the log, the session is successfully opened :
Session created: PlatformSession
name = defaultconnection = PlatformData
Connection
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 = 0
logger_name = sessions.platform.default.0
and after doing session.open() :
DEBUG:sessions.platform.default.0:Session.update_access_token(access_token='XXX')
[2025-05-27T08:22:32.169568+00:00] - [DEBUG] - [sessions.platform.default.0] - [130721702053440] | AuthManager-Thread
AuthManager: Refresh token will be requested in 299 seconds
DEBUG:sessions.platform.default.0:AuthManager: Refresh token will be requested in 299 seconds
[2025-05-27T08:22:32.169667+00:00] - [DEBUG] - [sessions.platform.default.0] - [130723949191168] | MainThread
AuthManager: end authorize, result True
DEBUG:sessions.platform.default.0:AuthManager: end authorize, result True
[2025-05-27T08:22:32.179932+00:00] - [DEBUG] - [sessions.platform.default.0] - [130723949191168] | MainThread
Opened session
DEBUG:sessions.platform.default.0:Opened sessionHowever when i try to test the connection using a simple call
ld.get_history("ESc1")
I get
AttributeError: No default session created yet. Please create a session first!
Any ideas ?
Thank you
0 -
Maybe one more piece of information :
I re ran the simple
ld.open_session()
with my lseg-data.config.json file as before.
The session opens successfully
Opened session
DEBUG:sessions.platform.ldp.0:Opened session
However when i call
ld.get_history("ESc1")
I see the correct data in the debug print, but i get
TypeError: NDFrame.infer_objects() got an unexpected keyword argument 'copy'
Not sure if this is related to the session issue
0 -
1
-
Hello @adam.leroux
If you need to create a session with session = ld.session.platform.Definition code, you need to set that session to a LD default session before start call get_data get_history, etc. methods.
session = ld.session.platform.Definition(
app_key = os.getenv("APP_KEY"),
grant = ld.session.platform.GrantPassword(
username = os.getenv("USERNAME"),
password = os.getenv("PASSWORD")
),
signon_control=True
).get_session()
ld.session.set_default(session)
session.open()
ld.get_history("EUR=")
#Got Data0
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 中文论坛