Skip to content

Commit

Permalink
remove legacy and unnecessary @Property site_content_url
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomezvillamor committed Dec 24, 2024
1 parent b1efd9b commit 8e3fdc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
26 changes: 7 additions & 19 deletions metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check warning on line 914 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L914

Added line #L914 was not covered by tests
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)

Check warning on line 920 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L920

Added line #L920 was not covered by tests

def _populate_usage_stat_registry(self) -> None:
if self.server is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)
Expand Down

0 comments on commit 8e3fdc8

Please sign in to comment.