You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/09 21:00:17 UTC

[GitHub] [airflow] ashb commented on a change in pull request #20180: Remove db call from `DatabricksHook.__init__()`

ashb commented on a change in pull request #20180:
URL: https://github.com/apache/airflow/pull/20180#discussion_r766150280



##########
File path: airflow/providers/databricks/hooks/databricks.py
##########
@@ -303,6 +299,14 @@ def _do_api_call(self, endpoint_info, json):
         :rtype: dict
         """
         method, endpoint = endpoint_info
+
+        self.databricks_conn = self.get_connection(self.databricks_conn_id)
+
+        if 'host' in self.databricks_conn.extra_dejson:
+            self.host = self._parse_host(self.databricks_conn.extra_dejson['host'])
+        else:
+            self.host = self._parse_host(self.databricks_conn.host)

Review comment:
       ```suggestion
           if self.databricks_conn is None:
               self.databricks_conn = self.get_connection(self.databricks_conn_id)
   
               if 'host' in self.databricks_conn.extra_dejson:
                   self.host = self._parse_host(self.databricks_conn.extra_dejson['host'])
               else:
                   self.host = self._parse_host(self.databricks_conn.host)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org