Skip to content

Commit

Permalink
fix ISSUE-3137: updated-redash-library-and-function (#3157)
Browse files Browse the repository at this point in the history
  • Loading branch information
codingwithabhi committed Mar 4, 2022
1 parent 0d1fa67 commit ad341e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_long_description():
"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",
Expand Down
5 changes: 3 additions & 2 deletions ingestion/src/metadata/ingestion/source/redash.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_redash_dashboard_charts(self, dashboard_info) -> Chart:
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")
Expand All @@ -147,10 +147,11 @@ def get_redash_dashboard(self, dashboard_info) -> Dashboard:
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(
Expand Down

0 comments on commit ad341e8

Please sign in to comment.