When I query "https://api.refinitiv.com/data/datagrid/beta1/" with fields that have structured layout, the returned result is not aligned properly. The content of columns in each row seems to be linked randomly. A comparaison with excel confirmes the bug. This behaviour can be reproduced on many rics and many fields, so it's probably a bug in the api and not related to the content I am querying.
Example:
m_in = {
universe: ["ACCP.PA"],
fields : ["TR.TPEstValue.calcdate", "TR.TPEstValue.date", "TR.TPEstValue.brokername", "TR.TPEstValue"],
parameters={"SDate": "2022-07-01", "EDate": "2022-07-22"}
}
r = requests.post(url,headers={"Authorization": "Bearer " +TOKEN}, json=m_in)
m_out = json.loads(r.text)
df = pd.DataFrame(m_out["data"], columns=["ric", "calcdate", "date", "brokername", "value"])
df.sort_values(["calcdate", "date"])
The last 5 rows (once converted from json and sorted by calcdate,date)
calcdate date brokername value
2022-07-22 2022-06-27T03:15:00 Permission Denied 25632 NaN
2022-07-22 2022-06-28T00:05:00 Permission Denied 1120 NaN
2022-07-22 2022-06-28T06:26:00 Permission Denied 32 NaN
2022-07-22 2022-06-30T06:00:00 Permission Denied 398136 NaN
2022-07-22 2022-07-06T06:34:00 ODDO BHF NaN
Excel :
=@TR("ACCP.PA","TR.TPEstValue","SDate=2022-07-01 EDate=2022-07-22 RH=calcdate;date;brokername SORTA=calcdate;date")
Last 5 rows (issue is on all rows)
calcdate date brokername value
22/07/2022 27/06/2022 03:15 Permission Denied 25632 38
22/07/2022 28/06/2022 00:05 Permission Denied 1120 33
22/07/2022 28/06/2022 06:26 Permission Denied 32 36
22/07/2022 30/06/2022 06:00 Permission Denied 398136 31
22/07/2022 06/07/2022 06:34 ODDO BHF 32