issue using IPA API using RD and RDP library

dear developer community
i'm facing issue to use IPA API using RD and RDP libraries.
Indeed, i upgrade my machine to Win10 (64 bits) and i insattled the latest version for RD(1.1.1) and RDP (1.0.0a21) running on Python 3.10
the script that run well before rise error and exceptions once i upgrade windows and library versions.
many thanks for your assistance and help.
url= "https://api.refinitiv.com/data/quantitative-analytics/v1/financial-contracts"
the boy request:
{"fields": ["InstrumentTag","InstrumentCode","UnderlyingRIC","Strike", "CallPut","ExerciseStyle","UnderlyingPrice","MarketDataDate","MarketValueInDealCcy","VolatilityType","VolatilityPercent","DividendType","PricingModelTypeList","DividendCurveId","DiscountCurveId"],"universe": [{
"instrumentType": "Option",
"instrumentDefinition": {
"InstrumentTag":"ES_O_InputPrice",
"underlyingType": "Eti",
"instrumentCode":"ES4900C3"
},
"pricingParameters": {
"underlyingPrice":"4015.0"
}
},{
"instrumentType": "Option",
"instrumentDefinition": {
"InstrumentTag":"ES_O_InputPrice",
"underlyingType": "Eti",
"instrumentCode":"ES5050C3"
},
"pricingParameters": {
"underlyingPrice":"4015.0"
}
},{
"instrumentType": "Option",
"instrumentDefinition": {
"InstrumentTag":"ES_O_InputPrice",
"underlyingType": "Eti",
"instrumentCode":"ES4500C3"
},
"pricingParameters": {
"underlyingPrice":"4015.0"
}
},{
"instrumentType": "Option",
"instrumentDefinition": {
"InstrumentTag":"ES_O_InputPrice",
"underlyingType": "Eti",
"instrumentCode":"ES4600C3"
},
"pricingParameters": {
"underlyingPrice":"4015.0"
}
}],
"pricingParameters": {
"volatilityType":"SVISurface"
},
"outputs" : ["Data","Headers"]
}
An error occurred while requesting URL('http://localhost:9060/api/rdp/data/quantitative-analytics/v1/financial-contracts').
ReadTimeout('timed out')
Traceback (most recent call last):
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_exceptions.py", line 8, in map_exceptions
yield
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\backends\sync.py", line 26, in read
return self._sock.recv(max_bytes)
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_transports\default.py", line 218, in handle_request
resp = self._pool.handle_request(req)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\connection_pool.py", line 253, in handle_request
raise exc
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\connection_pool.py", line 237, in handle_request
response = connection.handle_request(request)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\connection.py", line 90, in handle_request
return self._connection.handle_request(request)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\http11.py", line 105, in handle_request
raise exc
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\http11.py", line 84, in handle_request
) = self._receive_response_headers(**kwargs)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\http11.py", line 148, in _receive_response_headers
event = self._receive_event(timeout=timeout)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_sync\http11.py", line 177, in _receive_event
data = self._network_stream.read(
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\backends\sync.py", line 24, in read
with map_exceptions(exc_map):
File "C:\Program Files\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
raise to_exc(exc)
httpcore.ReadTimeout: timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "H:/PARAM/DFR/Python/test.py", line 58, in <module>
body_parameters = json.loads(Global_Query)).get_data()
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\delivery\_data\_endpoint_definition.py", line 101, in get_data
response = self._provider.get_data(
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\delivery\_data\_data_provider.py", line 72, in get_data
raw_response = self.connection.send(request, session, *args, **kwargs)
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\delivery\_data\_connection.py", line 17, in send
return session.http_request(request)
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\_core\session\_session.py", line 485, in http_request
return self._http_service.request(request)
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\_core\session\http_service.py", line 342, in request
raise error
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\_core\session\http_service.py", line 317, in request
response = self._client.send(request)
File "C:\Program Files\Python310\lib\site-packages\refinitiv\data\_core\session\http_service.py", line 207, in send
response = client.send(request)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_client.py", line 902, in send
response = self._send_handling_auth(
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_client.py", line 930, in _send_handling_auth
response = self._send_handling_redirects(
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_client.py", line 967, in _send_handling_redirects
response = self._send_single_request(request)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_client.py", line 1003, in _send_single_request
response = transport.handle_request(request)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_transports\default.py", line 217, in handle_request
with map_httpcore_exceptions():
File "C:\Program Files\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\YAZANEAN\AppData\Roaming\Python\Python310\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout: timed out
Best Answer
-
Thanks for reaching out to us.
To verify what the problem is, you need to enable the debug log level in the Refinitiv Data Library. You can do this in the RD configuration file (refinitiv-data.config.json).
{
...
"logs": {
"level": "debug",
"transports": {
"console": {
"enabled": false
},
"file": {
"enabled": true,
"name": "refinitiv-data-lib.log"
}
}
},
"sessions": {
"default": "desktop.workspace",
...
}Then, you can check the refinitiv-data-lib.log file.
I hope that this information is of help.
0
Answers
-
dear @Jirapongse
i see a content difference in rdplibconfig.prod.json file between both versions, with a new option in the new version 'request-timeout', defaulted to 20.
when a change the value to 200 the script works without any error
rather than manage value at json file level, is it possible to fix timeout value in my script using rdp library
0 -
You can reset its value by using the following code.
rdp.configure.config["http.request-timeout"] = 200
0 -
dear @Jirapongse
it works perfectly, than you a lot.
a have another question regarding refinitiv-data.
can i use the same code for refinitiv data to customise the timeout request value.
i don't find refinitiv-data.config.json file as it's the case for refinitiv data platform.
0 -
The sample refinitiv-data.config.json is available on GitHub.
You can add the following configurations to change the value of the http.request-timeout configuration.
{
"http": {
"request-timeout": 60
},
"logs": {
...
}
...
}The code to change the value of the http.request-timeout configuration is:
rd.get_config()["http.request-timeout"] = 30
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 中文论坛