Title: Issues with Ingesting Mode Reports Metadata into DataHub and Solution Found

Original Slack Thread

Hi All, I am trying to ingest the mode reports metadata into datahub. I have followed the standard ingestion receipe and using the Mode Personal Access Token, It’s able to pull only the PAT’s personal report, not pulling any other reports from workspace. Am i missing something here?

<@UV14447EU> can you please help me on this use case or point some one else who can help?

Please refer the mode documentation https://mode.com/developer/api-reference/authentication/

Looks like you need workspace access token

PAT is not going to work to pull the all assets of a workspace

yes have tried that already.with workspace token as well, workspace doesn’t support API call’s used for ingestion, it fails saying Bad Request Url

Making the API call directly with same PAT token https://mode.com/developer/api-cookbook/reports/get-query-results/, we are able list all the reports/charts in the workspace. Same token pulls only report from personal folder via datahub ingestion

yes token is not an issue, datahub code is not looping all spaces and reports within workspace, just pulling only personal folder


<@U05QB530UUC> Could you please open a issue on DataHub GitHub? and post the issue here

<@U0348BYAS56> Found the issue with the space token URL. We need to add change in https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/ingestion/source/mode.py|mode.py

Function _get_space_name_and_tokens(self)
from :line 318
payload = self._get_request_json(f"{self.workspace_uri}/spaces")
payload = self._get_request_json(f"{self.workspace_uri}/spaces?filter=all")
Please let me know how to proceed to make this change to mode.py.

With the above change, able to pull all the charts & dashboards via UI ingestion.

<@U05RFBBUD5M> You can open a PR