question

Upvotes
19 4 4 9

rd.get_data queeps sending back annoying errors for real time requests 'Failure sending request'

Hi,

When using the code below, I keep getting 'Failure sending request with <class 'refinitiv.data._data.content.fundamental.fundamental_and_reference.Definition'>' error messages, even though I get the data that I'm after:


rd.get_data(
    ['GBP=', 'EUR=', 'JPY='],
    ['BID', 'ASK'])


1659620003345.png


The issue is that I have this in a loop, so for every data frame returned, I have many error messages to scroll through, be it in Jupyter or other IDEs...

I tried to ignore warnings, but that's bad practice and it didn't work anyway:

import warnings
warnings.filterwarnings("ignore")


Why are we getting this? why are we getting error messages for a field I didn't request?

pythonrefinitiv-dataplatform-libraries
1659620003345.png (76.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @danieluphromes

Can you provide the version of the 'refinitiv.data' library? The behavior is not expected and I will report to the development team.

Upvotes
46.8k 108 44 60

@danieluphromes

The get_data method is a high-level function.

rd.get_data(
    ['GBP=', 'EUR=', 'JPY='],
    ['BID', 'ASK'])

When running the code above, first, it will connect to the https://api.refinitiv.com/data/datagrid/beta1/ to convert the requested instruments to RICs. The get_data mothod can support other instrument types.

[2022-08-05 12:53:45,392] - [sessions.platform.rdp.0] - [DEBUG] - [31644 - MainThread] - [_data_provider] - [send] -     headers : {'Content-Type': 'application/json'}
    body : {'universe': ['GBP=', 'EUR=', 'JPY='], 'fields': ['TR.RIC']}
[2022-08-05 12:53:45,392] - [sessions.platform.rdp.0] - [DEBUG] - [31644 - MainThread] - [http_service] - [build_request] - Request to https://api.refinitiv.com/data/datagrid/beta1/
    method = POST

Then, it connects to the real-time streaming service to retrieve real-time fields (BID, and ADK).

The error message indicates that the account doesn't have permission to access the https://api.refinitiv.com/data/datagrid/beta1/ endpoint.

To get real-time fields, you can use the EX-2.02.01-Pricing-Snapshot.ipynb example instead.

1659679559622.png

This method does not use the https://api.refinitiv.com/data/datagrid/beta1/ endpoint to get RICs (TR.RIC).


1659679559622.png (24.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
12k 59 39 61

Hi @danieluphromes

I reached out to the development team and they confirmed the issue has been resolved in an upcoming release. The fix will be targeted in the release: 1.0.0b20 due to come out next Friday.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.