Cizz22 3 months ago
parent b4d7c35b73
commit a33a5e8f7f

@ -130,7 +130,6 @@ async def get_aeros_equipment_by_location_tag(*, location_tag: Union[str, List[s
json=aerosNodeReq, json=aerosNodeReq,
headers={"Content-Type": "application/json"}, headers={"Content-Type": "application/json"},
) )
response.raise_for_status()
aerosEquipmentData = response.json() aerosEquipmentData = response.json()
if not aerosEquipmentData: if not aerosEquipmentData:
@ -138,11 +137,13 @@ async def get_aeros_equipment_by_location_tag(*, location_tag: Union[str, List[s
status_code=status.HTTP_404_NOT_FOUND, detail="AerosEquipment not found" status_code=status.HTTP_404_NOT_FOUND, detail="AerosEquipment not found"
) )
response.raise_for_status()
df = pd.DataFrame(aerosEquipmentData) df = pd.DataFrame(aerosEquipmentData)
return df.drop_duplicates().to_dict('records') return df.drop_duplicates().to_dict('records')
except Exception as e: except httpx.HTTPStatusError as e:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)
) )

Loading…
Cancel
Save