Hi @anass.yazane.1For reference, I'd like to put the solution provided by the Customer support executive regarding the closed case number 10871053 here.
Upon collaborating with our backend teams and Dev, I was able to confirm that the issue lies on the RDP.Search python library function. To give more context to this, unlike the underlying RDP Search API, the RDP.Search python library function does not preserve the column order specified in the ‘SELECT’ parameter. It will be considered for a future enhancement, hopefully on the next version. For now, the only way to do this would be to manipulate the results to display the columns in the preferred order. A couple of possible ways to do this are below
import refinitiv.dataplatform as rdpimport pandas as pdimport datetime as dtInterval_IssueDate=30Interval_MatDate=365select_properties = "IssuerDescription,Currency,RIC,ISIN,CouponClass,MaturityDate,IssueDate,CouponRate,FaceIssuedTotal,AssetStatusDescription,SeniorityTypeDescription"rdp.open_desktop_session(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)df_NewIssues=rdp.search(view=rdp.SearchViews.GovCorpInstruments,filter= "MaturityDate gt " + str(dt.date.today()+dt.timedelta(days=Interval_MatDate)) + " and IssueDate gt " + str(dt.date.today()+dt.timedelta(days=-Interval_IssueDate)) + " and \ DbTypeDescription eq 'Corporate' and IssuerTicker eq 'CAFDDC' and IsActive eq true and not(AssetStatus in ('MAT' 'DC'))", select = select_properties, order_by= "IssueDate,Currency", top = 100)df_NewIssues[select_properties.split(","
import refinitiv.dataplatform as rdpimport pandas as pdimport datetime as dtInterval_IssueDate=30Interval_MatDate=365rdp.open_desktop_session(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)df_NewIssues=rdp.Search.search(view=rdp.SearchViews.GovCorpInstruments,filter= "MaturityDate gt " + str(dt.date.today()+dt.timedelta(days=Interval_MatDate)) + " and IssueDate gt " + str(dt.date.today()+dt.timedelta(days=-Interval_IssueDate)) + " and \ DbTypeDescription eq 'Corporate' and IssuerTicker eq 'CAFDDC' and IsActive eq true and not(AssetStatus in ('MAT' 'DC'))", select = "IssuerDescription, Currency, RIC, ISIN, CouponClass, MaturityDate, IssueDate, \ CouponRate, FaceIssuedTotal,AssetStatusDescription,SeniorityTypeDescription", order_by= "IssueDate,Currency", top = 100)df_NewIssues.data.rawResponse:{'Total': 5,'Hits': [{'IssuerDescription': 'BANQUE FEDERATIVE DU CREDIT MUTUEL SA', 'Currency': 'EUR', 'RIC': 'FR0014007PV3=', 'ISIN': 'FR0014007PV3', 'CouponClass': 'FIX', 'MaturityDate': '2027-11-19T00:00:00.000Z', 'IssueDate': '2022-01-19T00:00:00.000Z', 'CouponRate': 0.625, 'FaceIssuedTotal': 750000000, 'AssetStatusDescription': 'Issued', 'SeniorityTypeDescription': 'Senior Non-Preferred'}, {'IssuerDescription': 'BANQUE FEDERATIVE DU CREDIT MUTUEL SA', 'Currency': 'EUR', 'RIC': 'FR0014007PW1=', 'ISIN': 'FR0014007PW1', 'CouponClass': 'FIX', 'MaturityDate': '2032-01-19T00:00:00.000Z', 'IssueDate': '2022-01-19T00:00:00.000Z', 'CouponRate': 1.125, 'FaceIssuedTotal': 1250000000, 'AssetStatusDescription': 'Issued', 'SeniorityTypeDescription': 'Senior Non-Preferred'},etcetcLast line can also be changed to the following, to show only the records, not the total:df_NewIssues.data.raw['Hits']
hi @anass.yazane.1
This forum is dedicated to software developers using Refinitiv APIs.
The moderators on this forum do not have deep expertise in every bit of content available through Refinitiv products, which is required to answer content questions such as this one.
The best resource for content questions is the Refinitiv Helpdesk, which can be reached by either calling the Helpdesk number in your country or submitting a new ticket to the support team via MyRefinitiv.
The Helpdesk will either have the required content expertise ready available or can reach out to relevant content experts to get the answer for you.
sorry for this inconvenience, let me try to ask the RDP search expert to help answering this
Thank you for your patience, case number 10871053 has been raised and the content specialist should contact you to provide this information soon.
Hi @anass.yazane.1
In a past article, we encountered the same issue as you reported. While that article includes some additional functionality to deal with missing columns, it also addresses the order issue.
How we worked through the issue was to place the list of properties in an array:
# Define the collection of properties/fields within our result setproperties = ['IssuerDescription', 'Currency' , 'RIC', 'ISIN', 'CouponClass', 'MaturityDate', 'IssueDate', 'CouponRate','FaceIssuedTotal', 'AssetStatusDescription', 'SeniorityTypeDescription']
When you perform your search, you apply a simple token function when specifying the 'select' statement to present the required comma-delimited string. For example:
maturity=f'{dt.date.today()+dt.timedelta(days=365)}'issuedate = f'{dt.date.today()+dt.timedelta(days=-30)}'response = rdp.Search.search( view = rdp.SearchViews.GovCorpInstruments, filter= f"MaturityDate gt {maturity} and IssueDate gt {issuedate} " + \ "and DbTypeDescription eq 'Corporate' and " + \ "IssuerTicker eq 'CAFDDC' and IsActive eq true " + \ "and not(AssetStatus in ('MAT' 'DC'))", select = ','.join(properties))bonds = response.data.df
If you were to display the response as is, you can observe the order issue:
However, because you placed your field input as an array, you can simply do this:
bonds[properties]