pyapacheatlas icon indicating copy to clipboard operation
pyapacheatlas copied to clipboard

**Subject: Issue Retrieving Lineage with Azure Purview API**

Open jguajardobravo opened this issue 6 months ago • 0 comments

          **Subject: Issue Retrieving Lineage with Azure Purview API**

I am experiencing an issue when trying to retrieve lineage data using the Azure Purview API. I have tried several approaches, but none are working. Below is a snippet of the code I am using:

`# Retrieve complete lineage using the REST API lineage_guid = "b9205209-..." # Replace with the GUID of the root entity for which you want to retrieve the lineage url = f'https://{PURVIEW_ACCOUNT_NAME}.purview.azure.com/catalog/api/atlas/v2/lineage/{lineage_guid}?depth=10&direction=BOTH'

response = requests.get(url, headers=headers)

if response.status_code == 200: lineage_data = response.json() print("Lineage retrieved...") print(lineage_data) print(json.dumps(lineage_data, indent=4)) else: print(f"Error retrieving lineage: {response.status_code}") print(response.text) return`

However, the response I get is as follows:

{ "baseEntityGuid": "b9205209-...", "lineageDirection": "BOTH", "lineageDepth": 10, "lineageWidth": 10, "childrenCount": -1, "guidEntityMap": {}, "includeParent": false, "relations": [], "parentRelations": [], "widthCounts": { "OUTPUT": {}, "INPUT": {} } }

For me, this seems like there might be a permissions issue or a misconfiguration in the lineage options. When I check within Purview, I can see the lineage properly configured: image

The service principal being used for this purpose is capable of retrieving any information from the glossary. This is the main reason why I think permissions for my service principal are properly set.

Could anyone provide insights on what might be wrong or suggest additional configurations I need to check?

Thank you!

Originally posted by @jguajardobravo in https://github.com/wjohnson/pyapacheatlas/issues/103#issuecomment-2271362431

jguajardobravo avatar Aug 06 '24 16:08 jguajardobravo