Minor: Remove trailing slash from FivetranClient base URL (#17528)

* fix: Remove trailing slash from FivetranClient base URL

* chore: use a method created for removing trailing slash
This commit is contained in:
Ayush Shah 2024-08-21 18:32:16 +05:30 committed by GitHub
parent c08b83f41d
commit 7ada44a315
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -33,6 +33,7 @@ from metadata.ingestion.source.dashboard.metabase.models import (
MetabaseUser,
)
from metadata.utils.constants import AUTHORIZATION_HEADER, NO_ACCESS_TOKEN
from metadata.utils.helpers import clean_uri
from metadata.utils.logger import ingestion_logger
logger = ingestion_logger()
@ -78,7 +79,7 @@ class MetabaseClient:
self.config = config
session_token = self._get_metabase_session()
client_config: ClientConfig = ClientConfig(
base_url=str(self.config.hostPort)[:-1], # remove trailing slash
base_url=clean_uri(str(self.config.hostPort)),
api_version=API_VERSION,
auth_header=AUTHORIZATION_HEADER,
auth_token=lambda: (NO_ACCESS_TOKEN, 0),

View File

@ -20,6 +20,7 @@ from metadata.generated.schema.entity.services.connections.pipeline.fivetranConn
FivetranConnection,
)
from metadata.ingestion.ometa.client import REST, ClientConfig
from metadata.utils.helpers import clean_uri
class FivetranClient:
@ -36,7 +37,7 @@ class FivetranClient:
)
client_config: ClientConfig = ClientConfig(
base_url=str(self.config.hostPort),
base_url=clean_uri(str(self.config.hostPort)),
api_version="v1",
auth_header="Authorization",
auth_token=lambda: (api_token[2:-1], 0),