From 8e3fdc8c04a10258dfbfb5eb1f57d0cdad9188af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez=20Villamor?= Date: Tue, 24 Dec 2024 11:46:50 +0100 Subject: [PATCH] remove legacy and unnecessary @property site_content_url --- .../ingestion/source/tableau/tableau.py | 26 +++++-------------- .../tableau/test_tableau_ingest.py | 1 - 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py index 0d51e68f607508..508500ffe489b9 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py @@ -911,25 +911,13 @@ def dataset_browse_prefix(self) -> str: return f"/{self.config.env.lower()}{self.no_env_browse_prefix}" def _re_authenticate(self) -> None: - if self.site_content_url: - assert self.site_content_url is not None, "Site Content URL is required" - self.report.info( - f"Re-authenticating to Tableau site='{self.site_content_url}'" - ) - # Sign-in again may not be enough because Tableau sometimes caches invalid sessions - # so we need to recreate the Tableau Server object - self.server = self.config.make_tableau_client(self.site_content_url) - else: - self.report.warning( - message="Site Content URL is not set. Unable to re-authenticate.", - context=f"site_id={self.site_id}, site={self.site}", - ) - - @property - def site_content_url(self) -> Optional[str]: - if self.site and self.site.content_url: - return self.site.content_url - return None + self.report.info( + message="Re-authenticating to Tableau", + context=f"site='{self.site_content_url}'", + ) + # Sign-in again may not be enough because Tableau sometimes caches invalid sessions + # so we need to recreate the Tableau Server object + self.server = self.config.make_tableau_client(self.site_content_url) def _populate_usage_stat_registry(self) -> None: if self.server is None: diff --git a/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py b/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py index 97c7ba7c2c68a7..2c8e51d9e663b1 100644 --- a/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py +++ b/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py @@ -1010,7 +1010,6 @@ def check_lineage_metadata( ctx=context, platform="tableau", site=SiteIdContentUrl(site_id="id1", site_content_url="site1"), - site_id="site1", report=TableauSourceReport(), server=Server("https://test-tableau-server.com"), )