fix(sdk): throw errors on empty gms server urls (#8017)

This commit is contained in:
Harshal Sheth 2023-05-12 10:12:22 +05:30 committed by GitHub
parent 82afdb2c78
commit 9a2e990bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,13 +61,13 @@ class DataHubRestEmitter(Closeable):
retry_max_times: Optional[int] = None,
extra_headers: Optional[Dict[str, str]] = None,
ca_certificate_path: Optional[str] = None,
server_telemetry_id: Optional[str] = None,
disable_ssl_verification: bool = False,
):
if not gms_server:
raise ConfigurationError("gms server is required")
self._gms_server = gms_server
self._token = token
self.server_config: Dict[str, Any] = {}
self.server_telemetry_id: str = ""
self._session = requests.Session()

View File

@ -56,7 +56,7 @@ class DatahubRestHook(BaseHook):
conn: "Connection" = self.get_connection(self.datahub_rest_conn_id)
host = conn.host
if host is None:
if not host:
raise AirflowException("host parameter is required")
if conn.port:
if ":" in host: