From 7a03f4367becbf2e0651b9bce602643f3697278e Mon Sep 17 00:00:00 2001 From: Benji Lampel Date: Wed, 11 Jan 2023 14:00:35 -0500 Subject: [PATCH] Remove if guards checking for trailing '/'s --- fivetran_provider/hooks/fivetran.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fivetran_provider/hooks/fivetran.py b/fivetran_provider/hooks/fivetran.py index a62f9f5..41b2285 100644 --- a/fivetran_provider/hooks/fivetran.py +++ b/fivetran_provider/hooks/fivetran.py @@ -178,9 +178,7 @@ def get_connector_schemas(self, connector_id) -> dict: """ if connector_id == "": raise ValueError("No value specified for connector_id") - if connector_id[-1] != "/": - connector_id = connector_id + "/" - endpoint = self.api_path_connectors + connector_id + "schemas" + endpoint = self.api_path_connectors + connector_id + "/schemas" resp = self._do_api_call(("GET", endpoint)) return resp["data"] @@ -201,14 +199,12 @@ def get_metadata(self, connector_id, metadata) -> dict: metadata_values = ("tables", "columns") if connector_id == "": raise ValueError("No value specified for connector_id") - if connector_id[-1] != "/": - connector_id = connector_id + "/" if metadata not in metadata_values: raise ValueError( f"Got {metadata} for param 'metadata', expected one" f" of: {metadata_values}" ) - endpoint = f"{self.api_metadata_path_connectors}{connector_id}{metadata}" + endpoint = self.api_metadata_path_connectors + connector_id + "/" + metadata resp = self._do_api_call(("GET", endpoint)) return resp["data"]