From 6ddf7034ae21808c6ba3d13ba2ee34b86bf17b58 Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Thu, 4 May 2023 16:38:27 +0530 Subject: [PATCH] Add exception handling for tableau sheets (#11429) * Add exception handling for tableau sheets * remove meating --- .../ingestion/source/dashboard/tableau/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py b/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py index b24b469a8bb..28cf50ebbb6 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/tableau/client.py @@ -11,7 +11,6 @@ """ Wrapper module of TableauServerConnection client """ -import json from typing import Any, Callable, Dict, List from cached_property import cached_property @@ -94,9 +93,12 @@ class TableauClient: data_model_graphql_result = self._client.metadata_graphql_query( query=TABLEAU_SHEET_QUERY_BY_ID.format(id=sheet_id) ) - return TableauSheets( - **json.loads(data_model_graphql_result.text).get("data", []) - ) + + if data_model_graphql_result: + resp = data_model_graphql_result.json() + if resp and resp.get("data"): + return TableauSheets(**resp.get("data")) + return TableauSheets(sheets=[]) def sign_out(self) -> None: self._client.sign_out()