fix(tableau): restart server object when reauthenticating (#12182)

Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
This commit is contained in:
Sergio Gómez Villamor 2024-12-20 08:37:21 +01:00 committed by GitHub
parent acb76cd97c
commit eceb799e63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -896,10 +896,9 @@ class TableauSiteSource:
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 recreate the Tableau Server object
self.server = self.config.make_tableau_client(self.site_id)
@property
def site_content_url(self) -> Optional[str]: