mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-28 11:59:54 +00:00
fix(sdk): throw errors on empty gms server urls (#8017)
This commit is contained in:
parent
82afdb2c78
commit
9a2e990bed
@ -61,13 +61,13 @@ class DataHubRestEmitter(Closeable):
|
|||||||
retry_max_times: Optional[int] = None,
|
retry_max_times: Optional[int] = None,
|
||||||
extra_headers: Optional[Dict[str, str]] = None,
|
extra_headers: Optional[Dict[str, str]] = None,
|
||||||
ca_certificate_path: Optional[str] = None,
|
ca_certificate_path: Optional[str] = None,
|
||||||
server_telemetry_id: Optional[str] = None,
|
|
||||||
disable_ssl_verification: bool = False,
|
disable_ssl_verification: bool = False,
|
||||||
):
|
):
|
||||||
|
if not gms_server:
|
||||||
|
raise ConfigurationError("gms server is required")
|
||||||
self._gms_server = gms_server
|
self._gms_server = gms_server
|
||||||
self._token = token
|
self._token = token
|
||||||
self.server_config: Dict[str, Any] = {}
|
self.server_config: Dict[str, Any] = {}
|
||||||
self.server_telemetry_id: str = ""
|
|
||||||
|
|
||||||
self._session = requests.Session()
|
self._session = requests.Session()
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class DatahubRestHook(BaseHook):
|
|||||||
conn: "Connection" = self.get_connection(self.datahub_rest_conn_id)
|
conn: "Connection" = self.get_connection(self.datahub_rest_conn_id)
|
||||||
|
|
||||||
host = conn.host
|
host = conn.host
|
||||||
if host is None:
|
if not host:
|
||||||
raise AirflowException("host parameter is required")
|
raise AirflowException("host parameter is required")
|
||||||
if conn.port:
|
if conn.port:
|
||||||
if ":" in host:
|
if ":" in host:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user