New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
1 0 0 1

Parameters format does not work

I am raising this on behalf of client. Why does this script/parameter format does not work?


import refinitiv.data as rd

rd.open_session()

df = rd.get_data(

universe = ['AAPL.O'],

fields = ['TR.F.TotRevenue'],

parameters={'ReportingState': 'Orig'},

)


Kindly note that I have given this below script (codebook) to the client and it works for him. What is wrong with the above script? Client also said that above script worked for his friend but not for him.


import refinitiv.data as rd

rd.open_session()

df = rd.get_data(

universe = ['AAPL.O'],

fields = ['TR.F.TotRevenue(ReportingState=Orig)']

)

pythonworkspace#technologycodebooklseg-data-library
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
15.6k 33 5 10

Hi @Mayeen.Neri ,

I cannot replicate the issue. Could you please let me know what does the 'not work' behavior is here? Are there any error message returned?

1730432822231.png


1730432822231.png (35.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.

Upvote
87.8k 294 53 79

@Mayeen.Neri

The client can enable the debug log to verify what the problem is by using the following code.

import refinitiv.data as rd
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()
df = rd.get_data(
    universe = ['AAPL.O'],
    fields = ['TR.F.TotRevenue(ReportingState=Orig)'])

df
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
1 0 0 1
RDError                                   Traceback (most recent call last)
Cell In[1], line 6
      4 config.set_param("logs.transports.console.enabled", True)
      5 config.set_param("logs.level", "debug")
----> 6 df = rd.get_data(
      7   universe = ['AAPL.O'],
      8   fields = ['TR.F.TotRevenue'],
      9   parameters={"ReportingState": "Orig"},
     10 )

File c:\ProgramData\miniconda3\envs\eik\Lib\site-packages\refinitiv\data\_access_layer\get_data_func.py:126, in get_data(universe, fields, parameters, use_field_names_in_headers)
    124 if exceptions and all(exceptions):
    125     except_msg = "\n\n".join(exceptions)
--> 126     raise RDError(-1, except_msg)
    128 hp_and_cust_inst_data = HPAndCustInstDataContainer(stream_columns, stream_data, stream_df)
    129 adc_data = ADCDataContainer(adc_raw, adc_df, fields)

RDError: Error code -1 | The 'Orig' is unrecognized for parameter 'ReportingState'. Requested universes: ['AAPL.O']. Requested fields: ['TR.F.TOTREVENUE']     

This is the error i get @Jirapongse @raksina.samasiri

The extra config logging didn't output anything interesting, just the following

[I 10:05:35] [httpx] HTTP Request: GET http://localhost:9010/api/status "HTTP/1.1 200 OK"
[I 10:05:35] [httpx] HTTP Request: POST http://localhost:9010/api/handshake "HTTP/1.1 200 OK"
[I 10:05:39] [httpx] HTTP Request: POST http://localhost:9010/api/udf "HTTP/1.1 200 OK"
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.

@nicholsluke

Please set the config before opening the session.

import refinitiv.data as rd
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()
Upvotes
1 0 0 1
The other query also doesn't appear to work for me:
---------------------------------------------------------------------------
RDError                                   Traceback (most recent call last)
Cell In[2], line 3
      1 import refinitiv.data as rd
      2 rd.open_session()
----> 3 df = rd.get_data(
      4   universe = ['AAPL.O'],
      5   fields = ['TR.F.TotRevenue(ReportingState=Orig)'],
      6 )

File c:\ProgramData\miniconda3\envs\eik\Lib\site-packages\refinitiv\data\_access_layer\get_data_func.py:126, in get_data(universe, fields, parameters, use_field_names_in_headers)
    124 if exceptions and all(exceptions):
    125     except_msg = "\n\n".join(exceptions)
--> 126     raise RDError(-1, except_msg)
    128 hp_and_cust_inst_data = HPAndCustInstDataContainer(stream_columns, stream_data, stream_df)
    129 adc_data = ADCDataContainer(adc_raw, adc_df, fields)

RDError: Error code -1 | The 'ORIG' is unrecognized for parameter 'REPORTINGSTATE'. Requested universes: ['AAPL.O']. Requested fields: ['TR.F.TOTREVENUE(REPORTINGSTATE=ORIG)']
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.

import refinitiv.data as rd
config = rd.get_config()
config.set_param("logs.transports.console.enabled", True)
config.set_param("logs.level", "debug")
rd.open_session()
df = rd.get_data(
    universe = ['AAPL.O'],
    fields = ['TR.F.TotRevenue'],
    parameters={"ReportingState": "Orig"},
)
refinitiv_orig_error.txt

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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