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


tests/providers/databricks/hooks/test_databricks.py
setup_mock_requests(mock_requests, requests_exceptions.HTTPError, status_code=400)
        with mock.patch.object(self.hook.log, 'error') as mock_errors:
            with self.assertRaises(AirflowException):
                self.hook._do_api_call(SUBMIT_RUN_ENDPOINT, {})
            mock_errors.assert_not_called()
    def test_do_api_call_succeeds_after_retrying(self):
        for exception in [
            requests_exceptions.ConnectionError,
            requests_exceptions.SSLError,
            requests_exceptions.Timeout,
            requests_exceptions.ConnectTimeout,
            requests_exceptions.HTTPError,
        ]:
            with mock.patch('airflow.providers.databricks.hooks.databricks.requests') as mock_requests:
                with mock.patch.object(self.hook.log, 'error') as mock_errors:
                    setup_mock_requests(
                        mock_requests, exception, error_count=2, response_content={'run_id': '1'}
                    )
                    response = self.hook._do_api_call(SUBMIT_RUN_ENDPOINT, {})
                    self.assertEqual(mock_errors.call_count, 2)
                    self.assertEqual(response, {'run_id': '1'})
    @mock.patch('airflow.providers.databricks.hooks.databricks.sleep')
    def test_do_api_call_waits_between_retries(self, mock_sleep):