From ad341e825937d4d4e9f00faab056f8c0ccb3f7ea Mon Sep 17 00:00:00 2001 From: codingwithabhi <63392662+codingwithabhi@users.noreply.github.com> Date: Sat, 5 Mar 2022 01:32:08 +0530 Subject: [PATCH] fix ISSUE-3137: updated-redash-library-and-function (#3157) --- ingestion/setup.py | 2 +- ingestion/src/metadata/ingestion/source/redash.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ingestion/setup.py b/ingestion/setup.py index c18e70ac764..392a0720633 100644 --- a/ingestion/setup.py +++ b/ingestion/setup.py @@ -102,7 +102,7 @@ plugins: Dict[str, Set[str]] = { "presto": {"pyhive~=0.6.3"}, "trino": {"sqlalchemy-trino"}, "postgres": {"pymysql>=1.0.2", "psycopg2-binary", "GeoAlchemy2"}, - "redash": {"redash-toolbelt==0.1.4"}, + "redash": {"redash-toolbelt==0.1.9"}, "redshift": {"sqlalchemy-redshift==0.8.9", "psycopg2-binary", "GeoAlchemy2"}, "redshift-usage": { "sqlalchemy-redshift==0.8.9", diff --git a/ingestion/src/metadata/ingestion/source/redash.py b/ingestion/src/metadata/ingestion/source/redash.py index b4094829ba8..d5e17fa65af 100644 --- a/ingestion/src/metadata/ingestion/source/redash.py +++ b/ingestion/src/metadata/ingestion/source/redash.py @@ -124,7 +124,7 @@ class RedashSource(Source[Entity]): for dashboard_info in dashboard_info["results"]: dashboard_id = dashboard_info["id"] if dashboard_id is not None: - dashboard_data = self.client.dashboard(dashboard_info["slug"]) + dashboard_data = self.client.get_dashboard(dashboard_id) self.dashboards_to_charts[dashboard_id] = [] for widgets in dashboard_data.get("widgets", []): visualization = widgets.get("visualization") @@ -147,10 +147,11 @@ class RedashSource(Source[Entity]): dashboard_id = dashboard_info["id"] if dashboard_id is not None: self.status.item_scanned_status() - dashboard_data = self.client.dashboard(dashboard_info["slug"]) + dashboard_data = self.client.get_dashboard(dashboard_id) dashboard_url = ( f"{self.config.uri}/dashboard/{dashboard_data.get('slug', '')}" ) + dashboard_description = "" for widgets in dashboard_data.get("widgets", []): dashboard_description = widgets.get("text") yield Dashboard(