From f239189c614a5a352a792e4dd9d6fb9954413574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Villamor?= Date: Thu, 19 Dec 2024 18:02:24 +0100 Subject: [PATCH 1/4] fix(tableau): restart server object when reauthenticating --- .../src/datahub/ingestion/source/tableau/tableau.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py index 6cc2220d90fd9..daf3b509afc95 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py @@ -896,10 +896,9 @@ def dataset_browse_prefix(self) -> str: return f"/{self.config.env.lower()}{self.no_env_browse_prefix}" def _re_authenticate(self): - tableau_auth: Union[ - TableauAuth, PersonalAccessTokenAuth - ] = self.config.get_tableau_auth(self.site_id) - self.server.auth.sign_in(tableau_auth) + # Sign-in again may not be enough because Tableau sometimes caches invalid sessions + # so we need to restart the Tableau Server object + self.server = make_tableau_client(self.site_id) @property def site_content_url(self) -> Optional[str]: From e005868f16f34dd1cf1366b09c787fefdce6aad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Villamor?= Date: Thu, 19 Dec 2024 19:06:20 +0100 Subject: [PATCH 2/4] fix lint --- .../src/datahub/ingestion/source/tableau/tableau.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py index daf3b509afc95..2158d55207079 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py @@ -896,8 +896,8 @@ def dataset_browse_prefix(self) -> str: return f"/{self.config.env.lower()}{self.no_env_browse_prefix}" def _re_authenticate(self): - # Sign-in again may not be enough because Tableau sometimes caches invalid sessions - # so we need to restart the Tableau Server object + # Sign-in again may not be enough because Tableau sometimes caches invalid sessions + # so we need to restart the Tableau Server object self.server = make_tableau_client(self.site_id) @property From 4692800e05f369dfffe3d0edbdb0972a2b2b252f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Villamor?= Date: Thu, 19 Dec 2024 19:12:11 +0100 Subject: [PATCH 3/4] fix call --- .../src/datahub/ingestion/source/tableau/tableau.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py index 2158d55207079..bd6692d0bdca2 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py @@ -898,7 +898,7 @@ def dataset_browse_prefix(self) -> str: def _re_authenticate(self): # Sign-in again may not be enough because Tableau sometimes caches invalid sessions # so we need to restart the Tableau Server object - self.server = make_tableau_client(self.site_id) + self.server = self.config.make_tableau_client(self.site_id) @property def site_content_url(self) -> Optional[str]: From 0947b78243cf58af31c81137a5617534e4dfe835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Villamor?= Date: Fri, 20 Dec 2024 07:47:11 +0100 Subject: [PATCH 4/4] Update metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py Co-authored-by: Harshal Sheth --- .../src/datahub/ingestion/source/tableau/tableau.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py index bd6692d0bdca2..f17fe1aee9847 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py @@ -897,7 +897,7 @@ def dataset_browse_prefix(self) -> str: def _re_authenticate(self): # Sign-in again may not be enough because Tableau sometimes caches invalid sessions - # so we need to restart the Tableau Server object + # so we need to recreate the Tableau Server object self.server = self.config.make_tableau_client(self.site_id) @property