Skip to content

Commit

Permalink
feat(airflow): respect port parameter if provided (datahub-project#7945)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored May 2, 2023
1 parent bf86235 commit 6833494
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata-ingestion/src/datahub_provider/hooks/datahub.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def _get_config(self) -> Tuple[str, Optional[str], Optional[int]]:
host = conn.host
if host is None:
raise AirflowException("host parameter is required")
if conn.port:
if ":" in host:
raise AirflowException(
"host parameter should not contain a port number if the port is specified separately"
)
host = f"{host}:{conn.port}"
password = conn.password
timeout_sec = conn.extra_dejson.get("timeout_sec")
return (host, password, timeout_sec)
Expand Down

0 comments on commit 6833494

Please sign in to comment.