How to get bond mutual fund's duration in CODEBK

Options

I am looking at this trust case: 14416458

14416458 | Case | Salesforce

And the specialist directed the client to the attached coding script. The file is in .ipynb extension and I couldn't attach here, so I have changed the format to .txt file.

Used Portfolio ID 35014080, and at this code below, I run into an error:

Section:

portfolio_df = rd_portfolio_get_data(portfolio_code, PORTFOLIO_COLUMNS)
if len(portfolio_df) == 0:
print(f"Impossible to load Portfolio '{portfolio_code}'")

Issue:

/opt/conda/lib/python3.8/site-packages/refinitiv/data/_access_layer/get_data_func.py:57:FutureWarning: Parameter 'use_field_names_in_headers' is deprecated and will be removed in future library version v2.0./opt/conda/lib/python3.8/site-packages/refinitiv/data/content/fundamental_and_reference/_definition.py:147:FutureWarning: Parameter 'use_field_names_in_headers' is deprecated and will be removed in future library version v2.0.

Can someone please guide me how to fix this issue? Please feel free to edit the entire script and make it a working script to calculate the bond mutual fund duration please, thanks!

Best regards,

Shawn

Answers

  • Hello @Shawn,

    The LD library for Python is the strategic API, and migration to LD library should be quite straight forward. I would recommend that you use it and check, if you are still having issues.