When the token is used in the databricks connection, the host name is being pulled from extra json data

https://github.com/apache/airflow/blob/fdd9b6f65b608c516b8a062b058972d9a45ec9e3/airflow/providers/databricks/hooks/databricks.py#L160


I think the host name should be pulled from databricks_conn directly as the line 164, where basic auth is being used https://github.com/apache/airflow/blob/fdd9b6f65b608c516b8a062b058972d9a45ec9e3/airflow/providers/databricks/hooks/databricks.py#L164

Thanks!

Liusong


airflow/providers/databricks/hooks/databricks.py
"""
        Utility function to perform an API call with retries
        :param endpoint_info: Tuple of method and endpoint
        :type endpoint_info: tuple[string, string]
        :param json: Parameters for this API call.
        :type json: dict
        :return: If the api call returns a OK status code,
            this function returns the response in JSON. Otherwise,
            we throw an AirflowException.
        :rtype: dict
        """
        method, endpoint = endpoint_info
        if 'token' in self.databricks_conn.extra_dejson:
            self.log.info('Using token auth. ')
            auth = _TokenAuth(self.databricks_conn.extra_dejson['token'])
            host = self._parse_host(self.databricks_conn.extra_dejson['host'])
        else:
            self.log.info('Using basic auth. ')
            auth = (self.databricks_conn.login, self.databricks_conn.password)
            host = self.databricks_conn.host
        url = 'https://{host}/{endpoint}'.format(host=self._parse_host(host), endpoint=endpoint)
        if method == 'GET':
            request_func = requests.get
        elif method == 'POST':
            request_func = requests.post
        elif method == 'PATCH':
            request_func = requests.patch