Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Remove if guards checking for trailing '/'s
Browse files Browse the repository at this point in the history
  • Loading branch information
denimalpaca committed Jan 11, 2023
1 parent 8df8e61 commit 7a03f43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions fivetran_provider/hooks/fivetran.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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"]

Expand Down

0 comments on commit 7a03f43

Please sign in to comment.