Can someone help us debug this script: It seems to complain that the url wasn’t set, see below…

https://developers.lseg.com/en/article-catalog/article/understanding-a-portfolios-country-risk-exposure

It seems to complain that the url wasn’t set, see below…

RDError                                   Traceback (most recent call last)

Cell In[39], line 6

      2 fields = ['TR.PortfolioConstituentName','TR.PortfolioWeight', 'TR.CoRFractionByCountry',

      3           'TR.CoRFraction','TR.CoRFraction.countryname']

      5 # Choose a portfolio (Users simply change the value below to reflect their defined portfilio)

----> 6 data = rd.get_data('Portfolio(UBS ORCL Portf)', fields)

File ~\pyvenv\myenv\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 | 'dict' object has no attribute 'url'

Answers

  • nick.zincone
    nick.zincone admin
    edited January 3

    Hi @Greg_V

    Just to confirm, have you tried to use the "SAMPLE_GL_DEV" used within the example to ensure you can pull this data down? If so, I could not find the "UBS ORCL Portf" within PAL. If that entry does exist, make sure you use the reference under the "Code" column, not the "Name" column.